# Survey with sections saving to one row

**URL:** https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464
**Category:** Ask for Help
**Created:** [April 22, 2025, 1:11am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464 "2025-04-22T01:11:37Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Etu-IT](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/etu-it/32/94625_2.png) [@Etu-IT](https://community.glideapps.com/u/Etu-IT)
#### Post date: [April 22, 2025, 1:11am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/1 "2025-04-22T01:11:37Z")

</div>

Hello all,

I am creating a survey in my app for the users to fill out that has a lot of questions split into seven sections. The answers are saved to a google sheet when submitted as they need to be viewable by an external party. I am trying to get the following functionality and would appreciate any help:

1. User taps on a button for each section that shows checks a user-specific Boolean and shows the form container for that section.
2. User answers the questions in that section and taps submit. If the user has already answered any of these questions, their answers should be displayed here to be changed if needed
3. Upon tapping submit, Glide checks the google sheet to see if there is a row that matches their ID number, read from the User List. If a row exists, then the answers submitted are put in that row, overriding any existing data. If the row doesn’t exist, a new one is made.
4. User moves to the next section and continues answering questions.

I’m not sure how to get the submit action to check this and to write to a specific row. I also want to make sure that only the answers from that section are overwritten.

Any advice would be greatly appreciated, Thanks!

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 22, 2025, 2:30am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/2 "2025-04-22T02:30:04Z")

</div>

> [@Etu-IT](#):
>
> I’m not sure how to get the submit action to check this and to write to a specific row. I also want to make sure that only the answers from that section are overwritten.

Using an onSubmit action with a native form or form container is the wrong approach. By definition, a native form will _always_ add a new row when it is submitted, so by that time it is already too late.

To get the functionality you are looking for, you really need to build your own custom form and associated workflow.

---

<div class="post-metadata">

### Author: ![Etu-IT](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/etu-it/32/94625_2.png) [@Etu-IT](https://community.glideapps.com/u/Etu-IT)
#### Post date: [April 22, 2025, 2:55am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/3 "2025-04-22T02:55:28Z")

</div>

Ah I see, thanks for that. This would mean using a regular container containing the question and a button at the end I can customise I assume?

Are you able to provide any help with what I would need to do in the workflow to make it check/write to the specific row when the button is clicked?

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [April 22, 2025, 3:01am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/4 "2025-04-22T03:01:32Z")

</div>

> [@Etu-IT](#):
>
> Ah I see, thanks for that. This would mean using a regular container containing the question and a button at the end I can customise I assume?

Yes, more or less. See below:

> [@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 particular…

> [@Etu-IT](#):
>
> Are you able to provide any help with what I would need to do in the workflow to make it check/write to the specific row when the button is clicked?

You need something in that row that can be used to build a relation - probably a user email, assuming you are capturing that with each submission. So create a relation/query that matches user email with the signed in users email. If that relation/query is empty, it’s a new submission for that user (Add Row), if it’s not empty then you want to update the existing row via the relation/query.

---

<div class="post-metadata">

### Author: ![Etu-IT](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/etu-it/32/94625_2.png) [@Etu-IT](https://community.glideapps.com/u/Etu-IT)
#### Post date: [May 5, 2025, 2:06am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/5 "2025-05-05T02:06:34Z")

</div>

Hi Darren,

Finally getting back to this, its been a busy couple of weeks!

So I’m running into a couple of issues and I’m not sure what I’m doing wrong.  
I have the following:  
“Survey Results” Table (linked to a sheet in a google sheets document) to record the results. This has a Row ID column and a User Email Column.  
“Survey Question Values” Table to provide the options for Multi choice questions  
“User List” Table - Holds the user info. I have created a Relation column here looking at Survey Results and matching the user’s email address.

On the form page:  
Buttons that display each section when clicked. Each section is within a Container.

In the containers:  
A Choice component with the Chips style to allow a user to select more than one answer for each question.  
A text entry component that displays if the user selects “Other” in the choice component.  
A Submit button activating a workflow.

The workflow:  
If User Relation (in User List) is not empty, Set columns in User List → Survey Relation  
If User Relation is empty, Add Row to Survey Results.

The form does not seem to be working correctly, When I click on the choices, it overrides the first row of the Survey results and the submit always creates a new row. I’ve had a look at your custom form example, but I’m struggling to figure out how to adapt it to work for a survey with multiple choice answers.

Any help would be appreciated, please let me know if you would like any more clarity on what I have/what I am trying to acheive

---

<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: [May 6, 2025, 12:00am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/6 "2025-05-06T00:00:57Z")

</div>

> [@Etu-IT](#):
>
> The form does not seem to be working correctly, When I click on the choices, it overrides the first row of the Survey results and the submit always creates a new row.

Have you created a table with only one row for this form? It should use user-specific columns to prevent users from writing on top of each other.

Sounds like you’re just pointing your form to the Survey results table.

> [@Etu-IT](#):
>
> If User Relation (in User List) is not empty, Set columns in User List → Survey Relation  
> If User Relation is empty, Add Row to Survey Results.

If you configure your form correctly, the user should only be able to fill the form one time, a row is added to the results table.

Then, you display their results row, and allow them to edit (if needed). At this point, you either decide to use the same helper row above as the edit screen, or use a normal edit screen.

---

<div class="post-metadata">

### Author: ![Etu-IT](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/etu-it/32/94625_2.png) [@Etu-IT](https://community.glideapps.com/u/Etu-IT)
#### Post date: [May 12, 2025, 3:09am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/7 "2025-05-12T03:09:16Z")

</div>

Thanks ThinhDinh and Darren, I’ve got it working successfully now!

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [May 19, 2025, 3:09am UTC](https://community.glideapps.com/t/survey-with-sections-saving-to-one-row/81464/8 "2025-05-19T03:09:36Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
