Creating a macro

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

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. You will see an alert message if you have unsaved changes.

Boomi Flow 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.

Note:
—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).
—Boomi Flow does not allow external API calls as part of the macro.

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 glossary for a definition of terms and key concepts that appear in the Boomi Flow website, Drawing Tool, technical documentation, blogs, and marketing communications.