Bulk Load Sheet Macro Evaluation

Bulk load sheets can be configured to allow for macro evaluation.

The first row of a bulk load sheet has a variable to enable or disable macro evaluation (see Bulk Load Template Sheet Layout):

evaluate_macros: {True | False}
  • If the variable is set to True, macros in a sheet will be evaluated upon loading. In this case, it is important that:

    1. The macro be prefixed with fn.bulkload_evaluate.

    2. A named macro must be used, in other words, a data/Macros instance.

    3. If the named macro that is used evaluates to a boolean or integer value, it will be evaluated and the sheet will be processed with that value.

For example:

  1. If the sheet is used to update a site at its hierarchy, and the evaluate_macros: value is set to True in the first row, then:

    • The macro {{ fn.bulkload_evaluate macro.SITENAME }} will be evaluated to the site name when the sheet is loaded, but inserted as plain text.

    • The macro {{ fn.evaluate macro.SITENAME }} will be not evaluated to the site name when the sheet is loaded, but inserted as plain text.

    • The macro {{ macro.SITENAME }} will be not evaluated to the site name when the sheet is loaded, but inserted as plain text.

    • The macro {{ input.sitename }} will be not evaluated to the site name when the sheet is loaded, but inserted as plain text.

    • Rows containing entries with a combination of the type {{fn.bulkload_evaluate <named macro> }} and other types macros will only evaluate the former type and load others as plain text.

    • Macros (in any format above) entered into the Base columns of a sheet will not evaluate - for details on the Base columns, see Bulk Load Template Sheet Layout.

  2. If the sheet is used to update a site at its hierarchy, and the evaluate_macros: value is set to False in the first row, then all macros entered will be inserted as plain text.

Note

If the named macro needs to be tested with the macro evaluator, the format is {{ fn.evaluate macro.SITENAME }}.

  • See the topic on macros in VOSS Automate documentation for named macro examples.

  • For further details, also refer to the Advanced Configuration Guide and Named Macro Reference.