Online Help | Web App

Creating user macros

Introduced in 2025.2

Create new user macros when the pre-defined user macros do not provide the content or logic you need. Alloy Navigator enables you to create reusable, organization-specific text, dynamic values, or scripts for notifications, and messages.

To create a user macro:

  1. In the Workflow and Business Logic > Macros section, click + New. The New Macro pane is displayed.

  2. TIP: To base a new macro on an existing one, select the source macro and click Copy Item.

  3. Enter a name in the Name field.

  4. Optional: Enter a description of the macro in the Description field.

  5. Under Type, select one of the following macro types::

    • Text: Combines static text with placeholders for dynamic content, such as object fields and other macros.

    • PowerShell script: Uses a PowerShell script to generate the macro value.

    • SQL Script: Uses Transact-SQL statements to query the database and generate the macro value.

  6. If you plan to use the macro in e-mail notifications, under Output, select the macro output:

    • Plain Text: Produces unformatted text. Plain-text content is supported by all email clients, but it cannot include formatting, lists, alignment, images, or other HTML elements.

    • HTML: Produces HTML-formatted content. Use this option when the macro must include formatting, lists, tables, links, images, or other HTML elements. Some email clients may not display all HTML formatting consistently.

      NOTE: The appearance of HTML email notifications is controlled by standard cascading style sheet rules. For details, see Customizing E-mail Notification styles.

  7. Under This macro available for, define the context for the macro:

    • All objects: Makes the macro available globally.

    • Object class: Makes the macro available only for the selected object class. Select the object class from the list.

  8. In the Content section, enter the macro content. The available editor depends on the selected macro type:

    • For a Text macro, enter the text that will be inserted at runtime. When HTML output is selected, use the formatting toolbar to format the content. You can also select Source to edit the HTML directly.

    • For a PowerShell script macro, enter the PowerShell script that generates the required value.

    • For an SQL script macro, enter the Transact-SQL statements that query the database. When the macro runs, it returns the value from the first column of the first row produced by the last SELECT statement. For HTML output, the returned value can include HTML tags for formatting, tables, and lists.

      NOTE: Creating PowerShell Script and SQL Script macros requires appropriate knowledge of PowerShell or Transact-SQL. For information about Transact-SQL (T-SQL) syntax, statements, functions, and language elements, see the Microsoft Transact-SQL Reference: https://learn.microsoft.com/en-us/sql/t-sql/language-reference/.

To insert dynamic content into the macro, place the cursor where you want to add it and click Insert Placeholder. Then select an object field or another macro in the Select Placeholder window.

  1. Click OK.

TIP: E-mail Notifications and Message Box operations allow you to save message text as a macro, so you can create user macros on the fly based on the text you've entered.