URL Data Source for the Select Component
When configuring a 'select component' in an eForm, the data used can be sourced through a URL. The following steps will go over an example of how to perform this.
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email":
Sincere@april.biz
,
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
},
{
"id": 2,
...
..
.
1. Begin by adding a Select component to the eForm and entering the configuration window.
2. Select URL as the Data Source Type, enter the desired URL and enter the value property that will be used as the select value.
In this example we will use :
https://jsonplaceholder.typicode.com/users
3. Finally, set the item template in a format that fits with the JSON structure being used.
4. When all the configuration is complete, the select component will list data it receives from the API. If configured incorrectly it will yield an empty list, or "No choices to choose from".