Creating a macro

Content under development

You can execute JavaScript code from within your flow, by using the Macro element in ManyWho.

Some of the things macros can be used for:

  • Calculations: X times Y
  • Logic: If X is greater than Y, Then…
  • Data validation: If X == “”, Then generate an alert that X can not be empty

The macro element has its own editor in the Drawing Tool. You can access it by selecting Macros from the sidebar.

Here is how you can create a macro:

  1. Click Macros.
  2. Click New.
  3. Enter a name for the macro, and click Save.

    This saves the macro. An alert message reminds you that you need to add code to the macro.

ManyWho macros are shared elements – once created, a macro can be used by any flow in the tenant.

The macro needs to be imported in the flow, and added using the Operator element before it can be used.

—We recommend using JavaScript for logic, and not  asynchronous code.
—Macros should also not be used for generating an UI directly (use Players for that).
—ManyWho does not allow external API calls as part of the macro editor.

You may also want to see: 

If you need to take a closer look, click on the images to enlarge them. Have a question? Click the Help button on the bottom right-hand corner of this page to ask.

Check out the ManyWho glossary for a definition of terms and key concepts that appear in the ManyWho website, Drawing Tool, technical documentation, blogs, and marketing communications.