How is the best approach to escape double brace , specially for defining a default
in a parameter of Make SDK (integromat.com)?
I have an RPC
that returns two read-only ("disabled": true
) fields with a content and example and they use the same double brace that Make uses.
So, I need to understand if there is a way to show the double brace as it is, not interpreted like an parameter in Make Scenario.
RPC
Reference: Dynamic Fields RPC - Make Apps (integromat.com)
rpc://templatesGetExpectById
{
"url": "/v1/templates/{{parameters.templateId}}",
"method": "GET",
"qs": {
"organizationId": "{{parameters.organizationId}}"
},
"response": {
"output": [
{
"name": "templateId_{{body.id}}_content",
"label": "Content",
"type": "text",
"disabled": true,
//"default": "{{ body.content }}"
"default": "{{ decodeURL( replace( replace( body.content, '{{', '%7B%7B%7B' ), '}}', '%7D%7D%7D' ) ) }}"
//"default": "{{ replace( replace( body.content, '{{', '`{{' ), '}}', '}}`' ) }}"
//"default": "{{ replace( replace( body.content, '{{', '{' ), '}}', '}' ) }}"
//"default": "{{ 'Hi {{name}}, this is an example of string with parameter with double brace.' }}"
},
{
"name": "templateId_{{body.id}}_example",
"label": "Example",
"type": "text",
"disabled": true,
"default": "{{body.example}}"
}
]
/** Example Response
{
"channelId": "YUJQXx0GQeKDWd1N",
"label": "Request Message",
"category": "SUPPORT",
"content": "Hello, {{1}}. Can we talk about your request {{requestid}} ?",
"example": "Hello, John. Can we talk about your request #9981 ?",
"status": "APPROVED",
"approvedAtUTC": "2022-10-05T20:10:23.498Z",
"id": "Yz2io0ke7ZKAhicn",
"createdAtUTC": "2022-10-05T15:28:35.882Z"
}
*/
}
}
Parameters (Usage of the RPC)
Reference: Parameters - Make Apps (integromat.com)
Example of usage of the parameter (expect.imljson
)
[
{
"name": "chatId",
"type": "text",
"label": "Chat ID"
},
{
"name": "organizationId",
"type": "select",
"label": "Organization ID",
"required": true,
"options": {
"store": "rpc://membersMeOrganizations",
"nested": [
{
// Template by Organization
"name": "templateId",
"type": "select",
"label": "Template",
"options": {
"store": "rpc://templates",
"nested": "rpc://templatesGetExpectById"
}
}
]
},
"mode": "edit"
},
{
"name": "params",
"type": "array",
"spec": {
"type": "text"
},
"label": "Params"
}
]
Example in a Scenario
So, the result is like the print below, but I need to show the RAW value, not interpreted like name
is a parameter from Make.
I tried a few options, but none worked:
"default": "{{ replace( replace( body.content, '{{', '`{{' ), '}}', '}}`' ) }}"
"default": "{{ replace( replace( body.content, '{{', '{' ), '}}', '}' ) }}"
Also tried the approach @Krzysztof_Rupinski suggest, imagining it was the solution. But the result keeps the same, unfortunately.
"default": "{{ decodeURL( replace( replace( body.content, '{{', '%7B%7B' ), '}}', '%7D%7D' ) ) }}"
The best so far it was the option below:
"default": "{{ decodeURL( replace( replace( body.content, '{{', '%7B%7B%7B' ), '}}', '%7D%7D%7D' ) ) }}"