Hi,
I’m building a custom app and I’m usinc nested rpc in my modules.
So the first rpc retrieves workspaces, the second objects inside the workspace ans the thirs fields that are inside the object.
{
"name": "workspace",
"type": "select",
"label": "Workspace",
"required": true,
"options": {
"store": "rpc://rpcWorkspace",
"nested":[
{
"name": "object",
"type": "select",
"label": "Object",
"required": true,
"options": {
"store":"rpc://rpcObject",
"nested": [
{
"name": "fields",
"type": "select",
"multiple": true,
"label": "Fields",
"required": true,
"options":"rpc://rpcField"
}
]
}
}
]
}
},
This is working fine on the user end but my issue is that this way when a user select a value, what is going to be sent are the IDs of those elements. And if they choose to map the values, instead of using the select elements, then they will enter the names of those elements.
Depending on this, I need to fill different fields in my request.
My question is, is there a way to know if the user has selected a value or if they mapped it?
Or is there a way to use the label instead of the value of the elements retrived in the rpcs?
Here is an exemple of one of my rpc :
{
"url": "/model/",
"method": "GET",
"response": {
"limit": 15,
"iterate": "{{body}}",
"output": {
"label": "{{item.name}}",
"value": "{{item._key}}"
}
},
"pagination": {
"qs": {
"offset":"{{pagination.page}}"
}
}
}
And the module communication :
{
"url": "/data/,
"method": "POST",
"body": {
"{{...}}":"{{omit(parameters, 'filters')}}",
"fieldByName":true,
"filters": {
"{{parameters.filters.fieldName}}":"{{parameters.filters.value}}"
}
},
"response": {
"output": {
"result":"{{body}}"
}
}
}