Hello there,
I’m trying to build a custom app, and I need to dynamically retrieve fields and populate them in the root module. However, I must use an input to load these fields. Specifically, I need to call the RPC after filling in the ID field, as shown below. The agent ID must be provided by the user, and the RPC response will return he dynamic fields. I can only make this work when I pass the fields manually or statically, like: ?agentId=123
, but the example below fails.
Action Mappable parameters (NOT WORK)
[
{
"name": "agentId",
"type": "uinteger",
"label": "Agent ID",
"required": true,
"default": 8794
},
"rpc://RetrieveAgentFieldsDetails"
]
Action Mappable parameters (WORK - HARD CODED)
[
{
"name": "agentId",
"type": "uinteger",
"label": "Agent ID",
"required": true,
"default": 8794
},
"rpc://RetrieveAgentFieldsDetails?agentId=123"
]
RPC Definition
{
"url": "/agents/{{parameters.agentId}}",
"method": "GET",
"response": {
"iterate": "{{body.questions}}",
"output": {
"name": "{{item.name}}",
"label": "{{item.name}}",
"type": "text",
"required": "{{item.required}}",
"description": "{{item.description}}"
}
}
}
I’ve tried different approaches to pass the agentId
to the RPC.