# How to handle removing Form Container entries when a user presses cancel?

**URL:** https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549
**Category:** Ask for Help
**Created:** [July 31, 2023, 2:41pm UTC](https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549 "2023-07-31T14:41:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![spamtes](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spamtes](https://community.glideapps.com/u/spamtes)
#### Post date: [July 31, 2023, 2:41pm UTC](https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549/1 "2023-07-31T14:41:46Z")

</div>

Hello,  
I’m stuck with how to handle a certain use case, I’m hoping someone could give me some ideas…

I’m trying to make a system to track what items users bring in and out of labs.  
the app is used to know which item(s) were brought in by who, and what users are using what **Lab**.

- I have 4 tables:
  1. **Users**
  2. **Items** (this is anything the user inputs)
  3. **Labs** (this is a fixed list)
  4. **Bookings**

An **Item** is anything - it’s added by a user when he/she books a room.  
The **Item** (s) can **only** be used in a **Lab**.

I have a ‘ **new form** ’ for **Bookings** , which has:

- **Form Container** for **Items** , saying “what items to do you have?”.
- A drop-down for the **Labs** for the user to select which lab he/she will use.

The User inputs details of the **items** in the **items** form container, and presses ‘submit’ which adds items to the Items table.

and finally, when he/she presses submit for the form, A row is added to the **bookings** table.

**PROBLEM:**

If the user presses ‘Submit’ in the Form Container for **Items** , but then presses cancel for the bookings **new form** , the result are items existing in the **Items** table without a Lab. (the user pressed cancel on the booking but added items.)

I would like to make it that if the user presses ‘Cancel’ in the new form, that all **Items** added via the form container in the **bookings** form are also removed.

I can imagine this is a common thing, any ideas on how I can do this?  
also,  
Is it possible to ‘stage’ all the changes to all the tables until the user presses submit?

Thanks-

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [July 31, 2023, 2:46pm UTC](https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549/2 "2023-07-31T14:46:55Z")

</div>

Might need some screenshots to see what you are doing. So you have a form that opens a second form on submit?

My initial thoughts are that you might need to rethink your flow.

---

<div class="post-metadata">

### Author: ![spamtes](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spamtes](https://community.glideapps.com/u/spamtes)
#### Post date: [July 31, 2023, 3:04pm UTC](https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549/3 "2023-07-31T15:04:21Z")

</div>

Hi Jeff,

Thanks a lot for your quick reply.  
Here’s the screenshot:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/7/f70acf4ac8fa666a83ded07e0337c0d7dd134d0a.png)

I also considered changing the flow,  
but the only ideas I have require the user to have some knowledge of how the app works.  
Picture a tablet on the door to a lab with this app running. Its got to be that the user uses 1 form to add items to him/herself and reserve the lab.

For example, I can’t add on-screen instructions like:  
“If you want to use this room, First, add your items using Form A, then, Book the Lab using form B”

Any ideas? Maybe i’m not thinking in the right way?

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [August 1, 2023, 1:01am UTC](https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549/4 "2023-08-01T01:01:03Z")

</div>

I think there are 2 options here

**Option 1**

Only allow users to book through the form you have, add items later in the details screen of the booking using another form (can be a form container, or a form screen).

**Option 2**

Use a custom form.

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particula…

Add a user-specific booking ID column in the work table for the form.

Add a single value column in the user profiles table to cast the booking ID value to that table (first \> Work table \> Booking ID column).

The button to open the form should check if a booking ID is presented. If presented, just show the details screen for the custom form row, else set a unique ID value to that column.

Now, every item added should contain the booking ID.

Since booking IDs are not cleared when the user moves back using a “Cancel” button you create, they will stay there until the user submits the booking (and you clear the booking ID, prepare for the next iteration).

---

<div class="post-metadata">

### Author: ![spamtes](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@spamtes](https://community.glideapps.com/u/spamtes)
#### Post date: [August 1, 2023, 1:50am UTC](https://community.glideapps.com/t/how-to-handle-removing-form-container-entries-when-a-user-presses-cancel/64549/5 "2023-08-01T01:50:32Z")

</div>

Hi Thinh,

Thanks a lot for your feedback,  
Your Option 2 advice gave me a few new ideas on how I might be able to do it.  
I’ll try again!

Thanks !
