Skip to main content
Version: 1.28 (Current)

Clear State (Obsolete)

Audience: Low-code Engineers

Skill Prerequisites: Actions, Forms, Tokens

Removes state that was saved under a key with Save State or Auto Save State, so Load State no longer finds it. It can clear the server session copy, the browser cookie, or both.

It doesn't change the values in the current form. 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​

  • Remove a draft once the form has been submitted, so the next visit starts empty
  • Offer a Start over button that forgets what was saved
  • Stop one form's state from being loaded into another form

Don't use it to​

  • Empty the fields of the current form. Clear State only removes the saved copy.
  • Delete a form report entry. Clearing a Browser Cookies state removes the cookie, not the entry it points to.
Action NameDescription
Save StateSaves the state that this action removes.
Load StateLoads saved state into the form.
Auto Save StateAsks the form to save its data in the browser while the user types.

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 LocationWhich state to remove: Server Session, Browser Cookies or Any. Any removes both. An empty value is treated as Any.NoAnyNo

What gets cleared​

Storage LocationWhat happens
Server SessionThe state under the key is removed from the user's session.
Browser CookiesIf the browser sent a cookie with the key, the cookie is expired, so the browser deletes it.
AnyBoth of the above.

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

Considerations​

  • Match the key. Use the same key as the Save State action. The user ID is added automatically for logged-in users.
  • Session storage outside the web server. If the site stores sessions outside the web server's memory, for example in SQL Server or a state server, Clear State doesn't remove the session copy. It only removes session state kept in memory.

Examples​

tip

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

1. Remove the draft after submitting​

This action, at the end of the submit button's actions, removes the OrderDraft state from both the session and the cookie.

{
"Title": "Clear State",
"ActionType": "ClearState",
"Description": "Forget the draft once the order is placed",
"Parameters": {
"Key": "OrderDraft",
"SaveLocation": "Any"
}
}

Revised 09/27/2026