---
sourceDocument: Australia Workflow Data Fabric
sourceDocumentLink: https://www.servicenow.com/docs/r/australia/integrate-applications

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Workflow Data Fabric

ft:clusterId :

    - crint

bundleId :

    - crint

workflow :

    - Creator


---

# Write a script for an automation message variable

# Write a script for an automation message variable {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Write JavaScript code input for variables that are added in the message of an insight
rule.

## Before you begin

This task must be performed in the classic environment.

Create an insight rule. For more information, see [Create an insight rule](https://www.servicenow.com/docs/~LZZVDA5RU3F1sqVEkESyA "Create an insight rule to generate custom insights for an automation business process.").

Role required: sn_ac.automation_technical_user or sn_ac.automation_admin

## About this task

When an insight rule is processed, it generates an insight. Insights appear on the
Insights widget in the Executions dashboard of Automation Center
Workspace.

An insight trigger activates the associated insight rule to run.

An insight rule doesn't run unless it's mapped to an insight trigger.

## Procedure

1. Navigate to AllAutomation CenterAdministrationInsight Rules.
2. Open an insight rule that you want to write JavaScript code for the associated message variable.
3. On the Automation Message Variables tab, select a variable.
4. On the form, fill in the fields.  
   {#create-message-variable-auto-center__table_pyx_mhd_4qb__entry__2}

   | Field | Description |
   |-|-|
   | Name | Name of the automation message variable. This field is auto-generated. |
   | Field | Qualifier for message variable. Values in this list appear depending on the entry that is selected in the Applies to field while you're creating an insight rule. This field appears only when the Applies to field is selected and when the Threshold type field is empty, while you're creating an insight rule. For more information, see [Insight rule form](https://www.servicenow.com/docs/DomzyTMeA1k6I1i4TIH_LQ "Use the Insight rule form to create an insight rule from Automation Center."). |
   | Application | Name of the associated application. This field is auto-generated. |
   | Automation insight rule | Name of the associated insight rule. This field is auto-generated. |
   | Advanced | Advanced script. This field is auto-generated. |
   | Script | Text field that accepts JavaScript code input and provides controls, such as syntax checking and formatting. For example, to return a value, enter <kbd class="ph userinput">return 100;</kbd>. This field doesn't appear when the Applies to field is selected and when the Threshold type field is empty, while you're creating an insight rule. For more information, see [Insight rule form](https://www.servicenow.com/docs/DomzyTMeA1k6I1i4TIH_LQ "Use the Insight rule form to create an insight rule from Automation Center."). |
   [Table 1. Automation message variable form]

   {#create-message-variable-auto-center__table_pyx_mhd_4qb}
5. Select Update.
{#create-message-variable-auto-center__steps_gj4_mvb_xtb}

*[\>]: and then


