Clear State (Obsolete)
Audience:
Low-code EngineersSkill 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.
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 Cookiesstate removes the cookie, not the entry it points to.
Related Actions
| Action Name | Description |
|---|---|
| Save State | Saves the state that this action removes. |
| Load State | Loads saved state into the form. |
| Auto Save State | Asks the form to save its data in the browser while the user types. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Key | The key the state was saved under, for example ContactForm. Use the same key as in Save State. | Yes | empty string | Yes |
| Storage Location | Which state to remove: Server Session, Browser Cookies or Any. Any removes both. An empty value is treated as Any. | No | Any | No |
What gets cleared
| Storage Location | What happens |
|---|---|
Server Session | The state under the key is removed from the user's session. |
Browser Cookies | If the browser sent a cookie with the key, the cookie is expired, so the browser deletes it. |
Any | Both 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
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