For the complete documentation index, see llms.txt. This page is also available as Markdown.

solution-state (set & reset)

Use actions to set or reset the solution states. These global variables are defined in the index.jigx file and can be referenced throughout the solution across multiple screens. Proper management of solution states ensures consistent behavior, shared logic, and synchronized data across your entire solution.

  • The set-solution-state action updates the global solution state, acting as a global variable accessible by multiple jigs and components.

  • The reset-solution-state action resets selected solution state keys to their initial values. If changes is omitted, it resets all solution state keys.

Refer to state for more information on the various state options and their respective functionality.


How to Configure a Solution State

Define the solution state variables

1

In your index.jigx file, add the states property.

2

Define each variable by specifying its key name and initialValue.

3

Solution states act as global variables, accessible to all jigs within the solution.

Set the solution state

1

Use the set-solution-state action to update one or more solution state variables.

2

You can trigger this action from any jig through an event (for example, onPress) or within a control’s action property.

3

When updated, the new values are instantly available to all jigs that reference the same state variable.

Reset the solution state

1

Use the reset-solution-state action to restore one or more solution state variables to their defined initialValues.

2

This is often done during logout, data refresh, or when resetting a workflow that spans multiple screens.

3

The changes parameter is optional. Omit it to reset all solution state keys.


Configuration Options

You can trigger set-solution-state or reset-solution-state actions in different ways, depending on when you want the state change to occur:

  • onFocus - executes the action when the screen gains focus.

  • onRefresh - executes the action when the screen is refreshed.

  • action - assigns the action as the primary screen action (for example, a toolbar or button action). The onPress and onChange actions will be executed when you trigger these events.

reset-solution-state supports two patterns:

  • Use changes to reset specific solution state keys.

  • Omit changes to reset all solution state keys.

Some properties are common to all actions, see Common action properties for the list of actions and their configuration options.

Examples and code snippets

Reset all solution state keys

Use this pattern when you want to clear the entire solution state and return every key to its configured initialValue.

This example shows how to set and reset solution state variables.

Setting Solution State

In this jig, you’ll find three dropdown components where you select:

  • Project

  • Site

  • Team

Each time you change a dropdown value, the corresponding solution state variable is updated automatically. These values persist as you navigate between jigs, allowing your selections to carry through to other parts of the app.

Two Main Actions

1. Start Your Day This action uses a go-to navigation to open the dashboard screen. On the dashboard, you’ll see the project, site, and team values you selected earlier — confirming that solution state variables are global and available anywhere in the solution, not just in the jig where they were set.

2. Cancel This action resets all solution state variables back to their initial value of "none". The dropdowns also reset to clear your selections, giving you a clean slate to start over with new choices.

Using Solution State in Actions

On the dashboard, a Submit Log action demonstrates how solution state variables can be used in downstream processes. When triggered, it creates a record in the Dynamic database, using the project, site, and team values stored in your global solution state, showing how these variables can easily be referenced across multiple jigs and actions.

Set & reset solution state
Set & reset solution state

Last updated

Was this helpful?