Hi guys,
I am building a custom app, and I ran into a roadblock on the “Update” module. I built an RPC to retrieve documents, and another that retrieves properties of a document based on RCP 1.
RCP 1
{
"url": "/automations",
"method": "GET",
"response": {
"iterate": "{{body.automations}}",
"output": {
"label": "{{item.title}}",
"value": "{{item._id}}"
}
}
}
RCP 2
Communications
{
"url": "/automations",
"method": "GET",
"headers": {
"Authorization": "Bearer {{connection.apiKey}}"
},
"response": {
"iterate":
{
"container": "{{body.automations}}",
"condition": "{{item._id = parameters.docId}}"
},
"output": {
"docId": "{{item._id}}",
"title": "{{item.title}}",
"isActive": "{{item.isActive}}",
"docTemplateLink": "{{item.docTemplateLink}}",
"saveGoogleDoc": "{{item.saveGoogleDoc}}",
"imageQuality": "{{item.imageOptions.quality}}",
"imageSize": "{{item.imageOptions.maxWidth}}",
"pdfExpiration": "{{item.pdfExpiration}}"
}
}
}
Parameters
[
{
"name": "docId",
"type": "text",
"label": "ID",
"required": true
}
]
In the update module, if am first prompting the user to select the doc, and based on that I want to retrieve the current values of the doc. How can I do this? This is what I have until now:
[
{
"name": "docId",
"type": "select",
"label": "Automation ID",
"required": true,
"mappable": false,
"options": {
"store": "rpc://rpcListAutomationNames",
"nested": [
{
"name": "title",
"type": "text",
"label": "Title",
"required": false
},
{
"name": "isActive",
"type": "boolean",
"label": "Is Active",
"required": false
},
{
"name": "docTemplateLink",
"type": "text",
"label": "Google Doc Template Link",
"required": false
},
{
"name": "saveGoogleDoc",
"type": "boolean",
"label": "Save Google Doc",
"required": false
},
{
"name": "imageQuality",
"type": "select",
"label": "Image Quality",
"required": false,
"options": [
{
"label": "Low",
"value": "low"
},
{
"label": "Eco",
"value": "eco"
},
{
"label": "Good",
"value": "good"
},
{
"label": "Best",
"value": "best"
}
]
},
{
"name": "imageSize",
"type": "select",
"label": "Image Size",
"required": false,
"options": [
{
"label": "200px",
"value": "200"
},
{
"label": "400px",
"value": "400"
},
{
"label": "600px",
"value": "600"
},
{
"label": "800px",
"value": "800"
},
{
"label": "1000px",
"value": "1000"
},
{
"label": "1500px",
"value": "1500"
},
{
"label": "2000px",
"value": "2000"
}
]
},
{
"name": "pdfExpiration",
"type": "select",
"label": "PDF Expiration",
"required": false,
"options": [
{
"label": "No Expiration",
"value": "never"
},
{
"label": "Immediate (5min)",
"value": "immediate"
},
{
"label": "1 Day",
"value": "oneday"
},
{
"label": "3 Days",
"value": "threedays"
},
{
"label": "1 Week",
"value": "oneweek"
},
{
"label": "2 Weeks",
"value": "twoweeks"
},
{
"label": "1 Month",
"value": "onemonth"
},
{
"label": "3 Months",
"value": "threemonths"
},
{
"label": "6 Months",
"value": "sixmonths"
},
{
"label": "1 Year",
"value": "oneyear"
}
]
}
]
}
}
]