Need the Lookup table Item API

POST [https://www.commcarehq.org/a/[domain]/api/[version]/lookup_table_item/]

I am using your lookup_table_item API for one of my clients. It successfully added the item to the lookup table with a status code 201, but it did not return anything. I need the id as a response, which will save me time, as I plan to use it in my application.

 {                                                                                                                                                                                                                                                                          
      "data_type_id": "bcf49791f7f04f09bd46262097e107f2",                                                                                                                                                                                                                      
      "fields": {                                                                                                                                                                                                                                                              
        "name": {                                                                                                                                                                                                                                                                
          "field_list": [                                                                                                                                                                                                                                                      
            {                                                                                                                                                                                                                                                                  
              "field_value": "MMR",                                                                                                                                                                                                                                            
              "properties": {"lang": "en"}                                                                                                                                                                                                                                                 
            }                                                                                                                                                                                                                                                                  
          ]                                                                                                                                                                                                                                                                    
        },                                                                                                                                                                                                                                                                     
        "price": {                                                                                                                                                                                                                                                              
          "field_list": [                                                                                                                                                                                                                                                      
            {                                                                                                                                                                                                                                                                  
              "field_value": "7",                                                                                                                                                                                                                                            
              "properties": {}                                                                                                                                                                                                                                                 
            }                                                                                                                                                                                                                                                                  
          ]                                                                                                                                                                                                                                                                    
        }                                                                                                                                                                                                                                                                      
      },                                                                                                                                                                                                                                                                       
      "id": "e8433b25e60c4e228b0c7a679af2847b",                                                                                                                                                                                                                                
      "item_attributes": {},   
      "sort_key": 2
 
    },

please solve my problem

thanks

Hi @wilayats

That is annoying, and requires just a small code change to improve.

I have made that code change, and opened a pull request for it. You can
follow the discussion on the pull request here: `LookupTableItemResource` returns data in API v0.6 by kaapstorm · Pull Request #34360 · dimagi/commcare-hq · GitHub

Once the pull request is merged, the code change will be deployed to commcarehq.org within a week.

A cautionary note: Lookup tables are included in the payload every time mobile users sync their devices. Large lookup tables will result in large payloads, and can slow down the sync process in low-bandwidth environments. This may not be a problem for you, but I thought it is worth being aware of.