Documentation

Action Settings

Explore Govform.com guidance, configuration details and practical steps for action settings.

Remove from cart actions

Use a Remove from cart action to remove one or more items from a named cart, or to clear the entire cart. It is essential when a person changes a previous selection and the service must not retain an item that is no longer relevant.

Configure removal with the same care as adding: an incorrect cart or item ID can remove a valid selection, while a missing removal action can leave stale data for review or downstream processing.

Choose the removal scope

Set the Cart ID to the collection you want to change. Then either identify the item or items to remove, or leave the item setting blank only when the whole cart must be cleared.

flowchart TD
  A[Person changes a selection] --> B{What is no longer relevant?}
  B -- One or more items --> C[Remove matching item IDs]
  B -- Entire collection --> D[Clear the named cart]
  C --> E[Review updated cart]
  D --> E

Prefer removing named items. Clear a full cart only when the entire collection has genuinely become invalid, such as restarting a selection stage.

Configure a removal action

  1. Add a Remove from cart action from Page actions.
  2. Give it a stable ID and a specific name, such as remove_unselected_product.
  3. Set the Cart ID.
  4. Add the Cart item ID or IDs to remove.
  5. Leave the item ID empty only for an intentional full-cart clear.
  6. Apply an execution condition that represents the change of route.
  7. Choose a trigger after the controlling answer has validated.
  8. Test changing the selection, returning to the page and resuming a draft.

The item ID supports Liquid, so it can be calculated from an answer or a preceding action. Keep dynamic item IDs constrained to known values and test a blank result before deploying.

Pair removal with the controlling decision

Use a condition that clearly states why the item should go. For example, when a person changes from “Add an additional service” to “No”, a condition can run the removal action for the additional-service item.

Do not use a broad cleanup action that clears data whenever a page loads. That can remove valid choices when someone returns to review or edit a different part of the journey.

Check downstream dependencies

Review pages, pricing logic, documents and external actions may use cart content. Put the removal action before any later action that reads the updated cart. Test the complete route so no document, email or external submission includes an item the person removed.

If an item has already been sent to an external system, removing it from the cart does not necessarily cancel it outside the service. Design a separate cancellation or amendment process for external consequences.

Test checklist

  • The action targets the intended cart.
  • Named item IDs remove only the intended item or items.
  • A blank item ID is used only for an intentional full-cart clear.
  • The removal condition reflects the business rule that makes the item irrelevant.
  • Revisiting or resuming the journey does not clear valid items.
  • Review, documents and later actions use the updated cart content.
  • External effects have a separate cancellation process where required.

Related guidance

Keep exploring

Explore more documentation

View all categories →