Macros
3 min read
When Trigger
or Action
receive or send data. Received data or status of sending can be utilized to configure the Macros
allow you to access these type of data by allowing you to specify a parameter name.
When creating/designing your Macros
are constructed from your test data. You can access these Macro
parameter names from previous Nodes in a latter steps of the Macros
also allow you to access individual field values of your data.
Though, Macros
represent test/sample data at design time, they represent real data when
How Macros
are represented?
Macros
are represented as {{#node-name:index.param-names}}
. So marco contains a parameter name delimited by {{#
and }}
.
where:
node-name
: This represents app, service or device Node in thegraph. e.g. google-mail Node as a Trigger
and google-drive Node as anAction
index
: This is the index of the Node in the graph, e.g. if you have two slack nodes to send messages, then one would have value1
& other value2
.param-names
: A hierarchy of parameter names as they found in the data JSON (see ICApp’s data formats)
If you take the above Gmail example, you may have test/sample received data for new emails would be something like (simplified version):
{
"title": "sample title",
....
"attachments":[
{
"filename": "image.png",
...
}
...
]
...
}
so when you try to configure google-drive Node. you would have following Macros
:
{{#google-mail:1}}
: contain full data received from Gmail as JSON{{#google-mail:1.title}}
: contain only email title- …
{{#google-mail:1.attachments[0].filename}}
: contain attachment file name, here attachments is a array to hold multiple attachments if your emails have received with multiple of them.
To configure google-drive Node to copy the attachment, you can use {{#google-mail:1.attachments[0].filename}}
in the google-drive Node configuration against the file name.
To select Macro
in a latter steps of the
For more information how to create and configure similar ICApp you can refer to Services Integration Guide
Substitution in Selection drop downs (or Combo Boxes)
Selection drop downs (or Combo Boxes) has names & values of your related data for the given field. Values are shown in parenthesis (if different from name). When using Macros
in selection drop downs, you must use Macros
having values of the field. e.g. if drop down has “Departments” name & ID values in parenthesis, the Macro
such as {{#conName:1.department.id}} will allow you to substitute the id values for the field and {{#conName:1.department.name}} will not resolve to the correct value expected as the field need the id (values are shown in parenthesis) instead of the name.