Skip to main content
Version: 1.28 (Current)

Load State (Obsolete)

Audience: Low-code Engineers

Skill Prerequisites: Actions, Forms, Tokens

Loads state that was saved under a key with Save State back into the form. The saved values replace the form's values with the same names, so fields and tokens get the saved values. It can read the server session, a browser cookie, or both.

The actions after it keep running. This action is only available in Forms.

caution

This action is obsolete. Existing forms keep working, but don't use it in new forms. As a suggestion, save the data to your own database table with Run SQL Query, and load it again when the form loads.

How form state works​

State is saved under a key. If a user is logged in, - and their user ID are added to the key. Server Session state is a copy of the form's data kept on the server. Browser Cookies state is a cookie that points to a saved form report entry. For the full explanation, see How form state works.

Typical Use Cases​

  • Pre-fill a form with values the user entered in another form, by loading the state in the form's On Init actions
  • Restore what a user entered earlier when they come back to a form
  • Make values from an earlier form available as tokens to a button's actions

Don't use it to​

  • Load data another user entered. State belongs to the user's own browser.
  • Load a form report entry by its ID. Use Load Entry (by ID) (Obsolete).
Action NameDescription
Save StateSaves the state that this action loads.
Clear StateRemoves saved state.
Auto Save StateAsks the form to save its data in the browser while the user types.
Update Form Data (AJAX)Refreshes the fields on screen after values change in a button's actions.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
KeyThe key the state was saved under, for example ContactForm. Use the same key as in Save State.Yesempty stringYes
Storage LocationWhere to look for the state: Server Session, Browser Cookies or Any. Any checks both. An empty value is treated as Any.NoAnyNo
Save data in ReportsDespite its name, this controls whether Server Session values replace values the form already has. When on, they replace them. When off, a saved value is only added if the form doesn't already have a value with that name. Form fields usually already have a value, even an empty one, so turn it off only to add extra values. It doesn't apply to Browser Cookies.NoTrueNo

What gets loaded​

Storage LocationWhat happens
Server SessionIf the session has state under the key, its values are copied into the form's data. Save data in Reports decides whether existing values are replaced.
Browser CookiesIf the browser sent a cookie with the key, the report entry it points to is loaded from the database. Its values always replace the form's values with the same names.
AnyThe session is checked first, then the cookie. If both exist, both are loaded, and the cookie's values are applied last.

The values are matched by name, so they work in a different form as long as the field names are the same. Loaded values are available as tokens to the actions that run after this one.

If nothing is saved under the key, nothing changes and no error is shown.

Considerations​

  • Use On Init to fill the fields. Values loaded in the form's On Init actions are shown when the form opens. In a button's actions, use Update Form Data (AJAX) afterwards to show them on screen.
  • Match the key and location. Use the same key as the Save State action. The user ID is added automatically for logged-in users, so state saved while anonymous isn't found after the user logs in.
  • Browser Cookies needs a saved report entry. The cookie only points to an entry. If the entry wasn't saved, nothing is loaded. See How form state works.
  • Errors are silent. If the saved data can't be read, nothing is loaded. Session errors are written to the log.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Pre-fill a form from the session​

This action, in the form's On Init actions, loads the state saved under ContactForm and fills the fields with the same names.

{
"Title": "Load State",
"ActionType": "LoadState",
"Description": "Pre-fill the contact details from the previous form",
"Parameters": {
"Key": "ContactForm",
"SaveLocation": "Session",
"SerilazeToReports": true
}
}

2. Load state from either location​

This action checks the session and then the cookie for the OrderDraft key. It only runs when the page was opened with ?Resume=yes in the URL.

{
"Title": "Load State",
"ActionType": "LoadState",
"Description": "Resume the saved order draft",
"Condition": "[QueryString:Resume] == \"yes\"",
"Parameters": {
"Key": "OrderDraft",
"SaveLocation": "Any",
"SerilazeToReports": true
}
}

Revised 09/27/2026