Macro Syntax Multiline¶
Macros can contain line breaks. The GUI provides a multiline input box for macros. For example:
If a macro that returns a string has string prefix or suffix, for example, a macro with the value:
"AAA {{data.Countries.iso_country_code | country_name:'South Africa'}} AAA"
will output:
AAA ZAF AAA
A JSON export of the macro will show the line breaks, for example:
"data": {
"macro": "AAA\n{{data.Countries.iso_country_code | country_name:'South Africa'}}\nAAA",
"name": "MACRO1"
}
If the macro is an Expect script:
expect "HQ>\r" send "enable\r" expect "Password:\r" send "{{device_details.enable_password}}\r"
Line breaks cannot be entered inside a macro, for example:
"AAA {{data.Countries.iso_country_code | country_name:'South Africa'}} AAA"
is not valid.