Macros
3 min read
When an Trigger
or Action
receives or sends data. Received data or status of sending can be utilized to configure the Macros
allows you to access these types 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 latter steps of the Macros
also allows 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}}
. Macro 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 example with Gmail, your test/sample received data for new emails would be something like (simplified version):
{
"title": "sample title",
....
"attachments":[
{
"filename": "image.png",
...
}
...
]
...
}
When you 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 the title of email- …
{{#google-mail:1.attachments[0].filename}}
: Contain the attachment file name. Here, attachments is a array to hold multiple attachments if your emails have received with multiples of them.
When configuring google-drive Node, you may need 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 latter steps of the
For more information on how to create and configure similar ICApps you can refer to Services Integration Guide
Substitution in Selection drop downs (or Combo Boxes)
Selection drop downs (or Combo Boxes) have 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” as the 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 Macro
such as {{#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.