[Index]

Model: tool/Macro

Macro Evaluator

The Macro Evaluator is available to test a macro at a hierarchy level. Refer to the macro functions, syntax and examples in the documentation.

  1. Choose General Tools > Macro Evaluator to open the Macro Evaluator input form.
  2. Enter the macro text in the Macro input box. By default, a macro {# data.Countries.* #} is entered as a test macro to evaluate.
  3. From the drop-down list, choose the Context Hierarchy at which the macro is to be evaluated.
  4. Enable and provide values for Context Data if required. Refer to the examples and Desginer Guide for macro reference topics.
  5. Click Evaluate to run the query.

The result of the evaluated macro is displayed in the Output box.

Macro Evaluator Examples

Consider to following macro examples in the macro Evaluator that show the use of the Context Data input. If the Show Context check box is enabled, JSON formatted values can be specified for testing a macro.

The example macro is provided with different context values, resulting in different output. For further details on macros, refer to the macro reference material in the Designer Guide.

Macro:

(( previous.test_attr == fn.null )) < New Value > < {{ previous.test_attr }} >
Context Data
{
   "input": {},
   "previous": {
       "test_attr": null
   }
 }
Output New Value

Another example of Context Data:

Context Data
{
   "input": {},
   "previous": {
       "test_attr": "YOYO"
   }
 }
Output YOYO