The ordering of the form fields is not reflected in the API. What should I do?
By default, the cols
response outputs form fields as objects.
In the Endpoint settings dialog, under "Advanced settings", set "cols_type" to [array] to output the objects in a specified order.
"cols_type" as array
Setting "cols_type" to [array] automatically outputs the cols
response in an ordered array.
Example output:
{
"cols": [
{"key": "ext_1", ...},
{"key": "email", ...},
{"key": "ext_2", ...},
{"key": "name", ...},
...
]
}
"cols_type" as object
If you leave "cols_type" blank or set it to [object], the cols
response will output objects in no particular order.
Example output:
{
"cols": {
"ext_1": {...},
"ext_2": {...},
"email": {...},
"name": {...},
...
}
}
However, the sorted key names are outputted under ordered_keys
.
You can use this to display the keys in a specified order on the front-end as follows:
{
"cols": {
...
},
"ordered_keys": [
"ext_1",
"email",
"ext_2",
"name",
...
]
}
Support
If you have any other questions, please contact us or check out Our Slack Community.