Can you call a rest service and map the data response to the drop-down field? I get an error when I try.
Can you call a rest service and map the data response to the drop-down field? I get an error when I try.
Hello?? Anyone home at Soti? What's the point of a discussion board if nobody uses it.
Hi Securis,
Apologies for the delay.
It is possible map the data response from an REST API to a Dropdown widget provided the response is an array. Once you have set up your REST API connection under Data Import/Export (Please let me know if you need any assistance with this), you can invoke the REST Data Connection at the required event and map the response as follows:
Once invoked in the app, you will see the dropdown list populated with the array elements from your response.
Depending on the type of the API response, you can use Blockly or Javascript to populate a Dropdown widget as well.
Please let me know if there are any further questions.
Thanks,

However, when I go to map it I don't see the [ ] like in your example. This is what I see:

Hi,
Would you be able to confirm if your API returns an array (can be of any type)? If not, is there any specific requirement to map a static response to a dropdown list? Ideally a response like that would be mapped to a textbox widget.
Here's an example of an array JSON response:
[
{"name":"Test1",
"ID": 1
},
{"name":"Test2",
"ID": 2
}
]
Thanks,
The response is an array. I put a screenshot of the array response above. It's not formated the same but it is an array.
Hi,
An array response should have the square brackets '[ ]' around it. Here's what the example I am using looks like when creating a REST API Data Connection:
The same square brackets symbolize and array when mapping the response:
If your response looks something like {1,2,3,4}, it won't be parsed as an array.
Please let me know if there are any questions.
Thanks,
The only difference between your response and mine is the word "Array" before the opening [. Does that matter? How do I talk to someone on the phone about this? I opened a case but the person who is working with me is not familiar with this.
Hi Securis, Can you please share your response structure, so that we can analyze it better and help you quickly, could not find your response structure.