Get Dependent Drop-down Values of a Lead Field
Lets you retrieve all dependent fields for a particular lead field’s value. You can also retrieve a specific dependent field by passing the “ChildSchemaName” parameter.
The “ChildSchemaName” and “Paging” parameters are optional.
For example, let’s assume you have –
- A parent drop-down field “Country” with values India and China
- A dependent (child) drop-down field “City” with values Delhi, Bangalore and Beijing, Shanghai. It behaves in the following way –
- If you select Country=India, the city field will display Delhi and Bangalore
- If you select Country=China, the city field will display Beijing and Shanghai
Following the example, here’s how you can use this API to retrieve the dependent drop-down values associated with say, India –
- In the “ParentSchemaName” parameter, pass the schema name of the “Country” field
- In the “ParentFieldValue” parameter, pass “India”.
- In the “ChildSchemaName” parameter, pass the schema name of the “City” field.*
*If you don’t pass the “ChildSchemaName” parameter, the values of all dependent fields associated with the “ParentFieldValue” will be retrieved.
The response of the example above will return Delhi and Bangalore.
API URL
Request
Content-Type: application/json{ "Parameter": { "ParentSchemaName": "mx_Country", "ParentFieldValue": "India", "ChildSchemaName": "mx_City" }, "Paging": { "PageIndex": 0, "PageSize": 3 } }
Request Parameters
Parameter | Description |
---|---|
ParentSchemaName | Schema Name of the parent drop-down field. |
ParentFieldValue | The values of the parent drop-down field you want to retrieve associated dependent values for. |
ChildSchemaName | Schema name of the dependent drop-down field. |
PageIndex | PageIndex specifies the page number. |
PageSize | Specifies the number of results per page. |
Response
{ "DependentFieldsOptionSet": [ { "DisplayName": "City", "FieldName": "City", "Options": [ "Delhi", "Bangalore" ] } ] }
HTTP Response Codes
Code | Description |
---|---|
200 OK | This is the status code for successful API call. |
401 Unauthorized | The API call was made with invalid access credentials. Check your AccessKey and SecretKey. |
400 Bad Request | The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure. |
404 Not Found | The API could not be found. Please check the API signature. |
429 Too Many Requests | API calls exceeded the limit of 25 in 5 second(s) |
500 Internal Server Error | The API called failed. There could be many reasons for it. Check the exception message to get more details. |