I need help to get dynamic mappable parameters name and value to create a request body for “POST” request.
Here below is my rpc function response.
[
{
"name": "attributes",
"label": "Attributes",
"type": "collection",
"spec": [
{
"name": 102,
"label": "Description",
"attributeId": 102,
"required": false,
"type": "text"
},
{
"name": 104,
"label": "Version",
"attributeId": 104,
"required": false,
"type": "number"
},
{
"name": 105,
"label": "Feedback",
"attributeId": 105,
"required": false,
"type": "text"
}
]
}
]
Below I have mappable parameters code
[
{
"name": "objectTypeId",
"label": "Object Type",
"required": true,
"type": "select",
"options": {
"store": "rpc://getObjectTypeTags",
"nested": [
{
"name": "objectId",
"label": "Object Id",
"required": true,
"type": "number"
},
"rpc://getFields"
]
}
}
]
Here i have communication code:
{
// Request to API endpoint with parameter "id" defined in Mappable parameters.
"url": "/Objects/data",
"method": "POST",
"headers": {},
"qs": {},
"body": [
{
"idAttribute": "{{parameters.attributes.attributeId}}",
"idObject": "{{parameters.objectId}}",
"value": "{{parameters.attributes.name}}"
}
],
"response": {
"output": "{{body}}"
}
}
I need to form the request body for the POST api as given below
[
{
"idAttribute": 0,
"idObject": 0,
"value": "string"
}
]
Output from the module while executing POST request.
Please help me, how can I create a request body for POST request.
Waiting for the response.