Context
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,User management
The Context actions work with the action context: the tokens and the users that the rest of the actions run with. They create and change tokens, save the tokens as JSON, and change which user [User:*] tokens and user actions refer to. The group also has obsolete actions that load form report entries.
Choosing an action
| Action | What it does | Use it to |
|---|---|---|
| Create/Update Tokens | Creates tokens or changes their values. Values can be evaluated more than once. | Combine or calculate values, or replace the tokens inside a stored template. |
| Context to JSON Object | Saves the current tokens as a JSON object in a token, filtered by name prefix. | Send a group of tokens to an API as one object, or inspect the tokens while debugging. |
| Context to JSON Array | Saves the current tokens as a JSON array of Name/Value pairs in a token. | Send tokens to an API that expects Name/Value pairs, or log them. |
| Change User | Makes another user the current user for the following actions. Available in Listings, API endpoints and InfoBox. | Read another user's [User:*] tokens, or run user actions on a user picked from a row or a request. |
| Load User | Loads one or more users into the context's list of users. The last one becomes the current user. | Load specific users before updating profiles, granting roles or sending emails. |
| Load Users from SQL | Adds the users a SQL query returns to the context's list of users. The current user doesn't change. | Grant a role to, email or clean up a group of users that match a condition. |
| Inject Data (obsolete) | Sets tokens, replacing tokens in the values once. | Nothing new. Use Create/Update Tokens instead. |
| Load Entry (by ID) (Obsolete) | Reloads a form with a saved form report entry, so the next submit updates it. | Nothing new. Save form data to your own table and load it with Run SQL Query instead. |
| Load Entry (by User ID) (Obsolete) | Reloads a form with the latest report entry a user submitted in it. | Nothing new. Save form data to your own table and load it with Run SQL Query instead. |
Tokens in the context
- Tokens only last for the current execution. Actions that run later in the same execution can use them, but the next request can't. To keep a value, save it in a database, a hidden field or the session.
- Existing tokens are overwritten. Setting a token that already exists replaces its value. Token names aren't case-sensitive, so
totalandTotalare the same token. - Recursion and user input. With Number of Recursions above
1, Create/Update Tokens also evaluates tokens inside the values. Only do that on content your application controls, because a user could type a token that reads data they shouldn't see. - Context to JSON is for internal use. The result can contain user data and internal values, and every value is written as a string. Use Include Prefixes to keep it small, and don't show it to end users. To build JSON with your own properties and types, use Create JSON Object.
The current user and the list of users
The context has a current user, which [User:*] tokens and user actions use when no user is given. It also has a list of users, which some user actions work on all at once.
| Change User | Load User | Load Users from SQL | |
|---|---|---|---|
| Users | One | One or more, separated by commas | Every user the query returns |
| Changes the current user | Yes | Yes, to the last user found | No |
| Adds to the list of users | No | Yes | Yes |
| When no user is found | The current user is cleared | Nothing changes | Loading stops and the error is logged |
These actions don't log anyone in or out. They only affect the rest of the current run of actions. To sign a user in, use User Login.
Considerations
- Check who's loaded. Delete User works on the whole list of users. Grant User Role, Revoke User Role, Authorize User and Unauthorize User work on the current user and on the whole list. Make sure the list only holds the users you mean to change.
- Don't trust the identifier. If a user identifier comes from the request, for example
[QueryString:UserId], a caller can change it to act on any user. Check that they're allowed first. - Scope the change. Put the user actions inside Execute Actions. When those actions finish, the current user and the list of users go back to what they were.
For actions that change users, see User Management. To turn JSON back into tokens, see Parsing.
Revised 10/02/2026