How do I collect data

So basically I have a tab that when pressing a button, you can get either “suggestions” form or “feedback” form but the forms aren’t like glide made forms. They are custom forms. I’ll be inserting images along the way so yall can get the gist of what I’m talking about as I’m not good at phrasing my issues.

Suggestion Form:

Feedback Form:

And all the components have visibility conditions set for them
Components:
image

Sheet:

The problem doesn’t lie here with the visibility as they appear how I intend them to appear.
(I know I could probably lower the amount of components but I’m still a noob at glide and I want them to be able to function first before I work on the amount of components :sweat_smile:)

So now all is left is the actions for the buttons. I can’t seem to collect the data while making it clear up after submitting and making it user-specific. Can someone help me by showing how should my sheet look like and how my custom actions should be. I know it is alot to ask but I hope someone can help me.

Notes:
My current actions are:

  • Top button = adding a row and setting a boolean true or false where if true, components for suggestion is shown and if false, components for feedback is shown (but I want to switch them because the base value of the boolean is always false? So I want suggestion page is always shown unless the user clicks feedback then the other components appear and the suggestion components dissappear, unless either of this can be done : a) the boolean base value for every row is true OR b) originally the tab is void of anything except those two buttons and when user clicks a button, the components for the button appears.

The actions for mine currently is add row where boolean is set to true and ID is set to userID. Add row is used so user can submit multiple entries

  • Bottom button = there is 2 buttons as shown but they should almost have the same functions.

The actions for mine currently is: Suggestion : if Name AND Author is empty then show notification. else add row where all the user-specific items entered by user is inserted to the non-user specific column. And the column values are set to clear the user-specific columns for Name AND Author AND Genre.
Feedback: is the same except the value is set to feedback column and feedback column which is user specific is cleared at the end

Why I say it doesn’t work how I intend? When I test it, No data is collected other than the user’s ID

My first thought is on the entry of this screen, I assume you’re letting users click another button, so you can set a default value for the column you’re using to control the visibility of components.

Let’s call that column “Visibillity”. If you’re not navigating from the same table as the “custom form” sheet, bring the “Visibility” value over to the other table, using a relation/lookup approach or a single value column. Then:

  • If Visibility is empty: Set it to true and show the “custom form”.
  • If Visibility is not empty: Just show the “custom form”.

By setting it to true, you’re making the default view “Suggestion”.

Normally, I write the name of the “view” directly to the column, so it would be suggestion/feedback instead of true/false, but that does not matter much.

1 Like

Then, for the submit button. I would add two separate buttons for the 2 cases (Suggestion & Feedback).

  • Suggestion button: Shows when visibility is true.

If Name is Empty OR Author is empty then show notification telling there’s an error (I assume you don’t want an AND there, since you would want both of the fields to be not empty).

If Name is Not Empty AND Author is Not Empty then add row, then clear all input columns in the current screen.

  • Feedback button: Show when visibility is NOT true.

If Feedback is Empty then show notification telling there’s an error.

If Feedback is Not Empty then add row, then clear all input columns in the current screen.

3 Likes

Well explained :point_up:

1 Like

I’m quite confuse (sorry for that) but this part is in the sheet part right and not in the button/tab part. So for the button what actions do I set it as? Do I add row or do I just set column values.

Also if it is the sheet part, I added a if-then-else column where if visibility column (which is user specific) is empty then true and if not empty I left the “then” empty. Is this right?

And do I need two columns for each data I wanna collect like Name, Author, Feedback where 1 is user-specific and another isn’t? Because I also want a user to be able to send multiple feedbacks/suggestions. So by making it user specific, will it affect that?

Let’s start with the screen before this screen first. What does your app look like before people navigate to this “custom form”?

1 Like

The flow is basically main screen →


Then 3 lines above which is menu →

Then Suggestions | Feedback →

Ah so it’s the top level of a tab, then it’s a bit more complex.

Do you have an onboarding flow for your app? Something like what Lucas has in the link below?

2 Likes

Nope. Do you want a link to my app so you can see how my app works?

I don’t have a complete vision of your flow, so forgive me if I make some wrong assumptions, but I think it could be simplified quite a bit.

  • First, I think you should have a separate “Form” table with a single row to act as your form. This table will contain all user specific columns. It should only ever have one row. Submitting the form should write to separate “Response” table.
  • Next, as I understand, your two buttons at the top create a row? I think that’s what is making things complicated. Instead, the buttons should only be setting a column value to true or false. You will be modifying the existing “Form” row instead of creating a new row every time the top buttons are clicked.
  • Next, make sure your visibility conditions are checking for ‘true’ or ‘not true’. Never check for ‘false’. A boolean column can be blank, false, or true. If you are specifically checking for true or false, then you are missing the times when it could be blank.
  • Finally, your submit button should be a custom action that first does an Add Row action which takes those values entered into the user specific “Form” columns and writes a new row in a separate “Response” table. Follow that with a Set Column action to clear all of the user specific form “Form” columns to reset the form.

This way you only write a row when the form is submitted instead of creating a row whenever someone flips back and forth between Suggestion or Feedback. I would also change the visibility conditions on the components so Suggestion components check for ‘not true’ and Feedback components check for ‘true’. That way the suggestion form is always the default.

2 Likes

AH so 2 tables in total?

Oh ok, so set values for the user specific table right?

Ah ok ok! I will go try that out now!

Ah right I forgot I could switch them… :sweat_smile:

I’ll edit this reply later if it works or not.

1 Like

Yes, two separate tables, and the top buttons only set true or false in the user specific “Form” table.

1 Like

Thanks alot!!! It works how I want it to work now! :bowing_woman:

1 Like

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