Values not populating into DB based on Choice components dependent fields


Please take a look at my issue below and Help!

Generalized Problem Scenario:
I’m trying to add two types of payments (not actual modes but just capturing these modes as text in the DB) - Cash and Digital (Wallet).

In the UI I’ve added the choice component to switch between the modes and dedicated fields get visible for each Mode of Payment (for Cash - Amount field only, for Digital - Amount, Wallet Name, Reference Number fields).

When in the Choice component Cash is selected and I enter a value in the Amount field (e.g. 100), then switch to Digital and enter a value in Amount field (e.g. 200) and submit the form.

When the form is submitted, both the amount values are getting sent to the database.

My expectation is, as a user when I’m submitting the form the amount value for the selected Mode of Payment only should be sent to DB and another value should not be sent to the database.

I’ve been facing this issue for a long time and couldn’t find a workaround for this. I hope someone can help me with this.

1 Like

Hi Manity,
I couldn’t help since I’m new to Glide as well.
Just need to understand your problem.
You received both data even if you didn’t click “Submit” for the first one?

This is the behaviour I have always seen. When you are in a form environment, any values that are in the screen and not empty will get submitted.

In many cases, we leverage this to submit default values when we don’t want users to edit, let’s say a text entry, but it causes problems in cases like this.

If your form is not hard to rebuild, you can consider doing a custom form and only add the right info to the destination sheet.