- 27 Mar 2025
- 8 Minutes to read
- Print
- DarkLight
- PDF
Configuring Dynamic Value Statements for Workflow Actions
- Updated on 27 Mar 2025
- 8 Minutes to read
- Print
- DarkLight
- PDF
Dynamic Value Statements allow you to dynamically populate Action fields within a Workflow Action node. To use this feature, enable Configure Dynamic Values.
Workflow Dynamic Value statements are similar to Enforcement Action Dynamic Value statements, with the following key differences:
- The Dynamic Value Statement Wizard, Syntax Helper, and Autocomplete feature do not support Event fields.
- In Workflow Actions, you can select asset modules other than the default asset type, under Asset Fields in the Syntax Helper.
- You can directly copy data from previous Workflow nodes into your Dynamic Value Statement using the Workflow Data repository.
- Enabling Fail the action if dynamic values fail only stops the current action; the Workflow continues.
- The Enforcement Action statement simulator is available in Syntax and Wizard modes, whereas the Workflow action statement simulator is only available in Syntax mode.
- Some non-trigger Action configurations require you to provide missing information before the Simulator can function. Learn how the Simulate feature works.
Using Data from Previous Nodes
When Configure Dynamic Values is enabled, the Workflow Data repository appears. Expand it by clicking the + icon in the header to copy data from prior Workflow nodes into your statement.
Using the Workflow Dynamic Value Statement Simulator
The Simulator allows you to test Dynamic Value Statements without running the Workflow.
- The Simulator operates similarly to the Enforcement Action simulator.
- It runs instantly on a random asset when:
- The Workflow Action runs on a built-in static query (i.e., based on static fields), inherited from the previous Action node or created in the current node.
- The Dynamic Value Statement includes only static fields.
- Otherwise, you must provide missing data before simulation.
- When the Workflow Action doesn't run on a query based on static fields.
- When the Dynamic Value statement includes non-static fields without data (i.e., from the Workflow Data repository).
The following table describes the scenarios in which you are required to fill in real data for the Action, Dynamic Value Statement, or both, before the simulator can run:
Action/Statement Configuration | Data Required |
---|---|
Action runs on a built-in custom static query (created in current Action or inherited from previous Action) | N/A |
Action runs on a built-in query that includes a non-static field from the Workflow Data repository (from previous nodes) | Fill in a value for the non-static field. |
Action runs on an Event asset retrieved from the previous node or on any asset from the Workflow Data repository (i.e. from any previous node) | Create a query based on the 'Runs on' asset type. |
All Statement fields are static. | N/A |
Statement includes one or more non-static fields without data from the Workflow Data repository (from previous nodes) | Fill in a value for each non-static field. |
To debug a Workflow Action Dynamic Value statement using the Simulator
- Make sure that the Dynamic Value statement is valid and that you have saved the Workflow.
The Simulator works only on validated statements in saved Workflows. If not validated, a Syntax validation error occurs and the Simulator does not work.
- Above the Dynamic Value statement in Syntax mode, click Simulate to activate the Simulator.
If the action runs on a query with static fields and the statement includes only static fields, Simulator Mode opens, and the Simulator immediately selects a random asset to use in the simulation. Learn more about a Simulator that requires no additional data.
If there is missing data in the action or statement, the Simulator - Add Missing Data dialog opens. Fill in the missing data and click Apply.
- If the Result shows an error (in red), depending on the error (for example, the component is incompatible with the statement or there are no assets that match the selected query), either choose another asset, or if this is not possible or does not work, click Exit Simulator Mode and return to step 2.
- Otherwise, the Simulator selects a random asset and begins the simulation.
The name of the randomly selected asset (max 12 characters) appears above the statement near Simulated on. Hover over the asset name to see the full name.
Hover over a component in the statement (function or field) to test it. The simulation immediately executes on the turquoise highlighted component, and the Result of the simulation appears below the statement box.
- It is recommended to first test the innermost component, as if it results in an error, simulation of any outer component will result in the same error.
- When the component is compatible with the statement, the Simulator shows the results in terms of Field type, Value type, and Value.
Click the asset to open its asset profile in a new tab.
Click the Replace button
to replace asset or data.
When you finish debugging the statement, click Exit Simulator Mode to leave the Simulator.
The Workflow action is now ready to run - either manually or according to a configured schedule.
No Missing Data
When a Workflow action runs on a built-in query that it inherits or creates, and the Dynamic Value statement uses static fields only, clicking Simulate initiates the simulation immediately. No additional data input is required.
See example below.
Adding the Missing Data
When the Simulator cannot run due to one or more of the following, the Simulator - Add Missing Data dialog opens:
- The action does not have a built-in query that returns assets.
- The action's built-in-query uses a non-static field, such as an event field.
- The Dynamic Value Statement includes one or more non-static fields.
Depending on what data is missing, do the following:
- Create a query that retrieves assets.
- Update a query with appropriate values.
- Assign real values to non-static fields in the Dynamic Value Statement.
Adding a Query to Action
Actions lacking a query (for example, those operating on assets resolved from an Event or data from the Workflow Data repository are not able to return assets for the simulator to run on.
In this case, in the Simulator - Add Missing Data dialog that opens, define a query. This query must retrieve assets of the appropriate type (matching the non-static fields used by the action).
For example, the action in the following screen runs on a user retrieved from previous Action node 71a (copied from the Workflow Data repository). Under Run On, create a Users query to provide sample assets for the simulation.
See example below.
Assigning Values to Non-Static Fields in Action Query
When a Workflow action runs on a query that utilizes non-static fields from preceding nodes (from the Workflow Data repository), the simulator is not able to retrieve assets for the run.
In this case, the Simulator - Add Missing Data dialog prompts you to provide actual values for these non-static fields.
For example, the following screen shows an Action query with non-static fields.
In the Simulator - Add Missing Data dialog, click View Query to show the query with the non-static field. Under Run On, enter a relevant value for the non-static ID field.
Assigning Values to Non-Static Fields in Dynamic Value Statement
When a Workflow action's Dynamic Value Statement includes one or more non-static fields, the simulation requires actual values to proceed. The Simulator - Add Missing Data dialog prompts you to assign actual values to each non-static field. See bottom part of screen below. Click View Statement to see the non-static fields in the statement.
The assigned values are only for the use of the Simulator. They do not replace the non-static fields in the statement.
See example below.
Replacing Workflow Statement Asset or Data
In a Dynamic Values statement for which the Simulator runs instantly (i.e., there is no need to fill in missing data), clicking the Replace button replaces the asset on which the simulator runs the statement.
When the Simulator requires you to provide missing data, clicking the Replace button presents a menu with two options:
- Replace Asset - This option prompts the system to randomly select a different asset for the simulation, maintaining the currently entered data.
- Replace Data. This option opens the Simulator -Add Missing Data dialog, enabling you to modify the data used for both the assets and the statement. The simulator then runs the statement using this new data on a newly selected asset.
To run the Simulator on a new asset
- For a statement with no missing data: Click the Replace button.
- For a statement with missing data: Click the Replace button and from the menu that opens, click Replace Asset.
To run the Simulator on new data and a new asset
- Click the Replace button and from the menu that opens, click *Replace Data.
- In the Simulator -Add Missing Data dialog, change the data for the asset and/or query, and click Apply.
Examples
Example 1
This is an example where there are a query and statement with no missing data.
The Axonius - Add Tag to Assets workflow action runs on the All Devices query that returns device assets, and the Dynamic Value Statement uses static fields only. Clicking Simulate runs the statement on a randomly selected asset.
Example 2
This is an example of an action that runs on a User asset retrieved by an Event and a Dynamic Value statement with non-static fields.
The Axonius - Add Tag to Assets action runs on the user on which the previous event occurred, and the tag name is set to the concatenation of event_first_name and event_last_name of that user.
Clicking Simulate above the statement opens the Simulator - Add Missing Data dialog. The non-static fields are indicated in the screen.
Clicking View Statement opens the Dynamic Value Statement (next screen).
The following screen shows the query built to return assets and real data assigned to the non-static fields in the statement.
When clicking Apply in the above screen, the Simulate begins immediately.
Clicking the Replace button opens a menu where you can Replace Asset or Replace Data.
The screen opens with the current data filled in (second screen of this example). The following screen shows a new query and new data filled in for the statement.
When clicking Apply in the above screen, the Simulate begins immediately on the new data and new asset.