Hello. I would like to offer my users the ability to enter information into the app via a form; by allowing them to either enter the bare minimum (for the form) or allowing them to add more details by tapping a button within the form. By tapping on the “add more details” button, I would like to redisplay the information they just entered - this could be read-only or editable.
Part of the reason I want to do this is so that I can present the user with different form fields depending on which category they selected in the smaller version of the form (i.e. the 1st form - see screenshot below).
FYI: I’m very new to Glide.
Thanks for the help!
I would use a custom form for this. The idea is you add a working table with a single row, then use it to house entry user-specific columns.
In the smaller version of the form, you let the user choose a category, then if it fits a condition then you add a button that routes the user to the same row, but you show more entry components.
@ThinhDinh Thank you for taking the time to write up a solution. Let me attempt to understand your recommendation…
Your suggestion was to “add a working table”… Does this mean I should create a new table in the Glide table editor with all the columns needed for the smaller version (Item name, category and photo) of the form? If I do this, will the user be able to modify those fields (from the short form) within the longer form (i.e. the one with specific fields based on the category)?
Your suggestion was to “routes the user to the same row”… How do I do that?
If you take a look at the Custom Forms demo app, you’ll see an example of a working table being used.
For your specific use case - creating a parent record, followed by a number of associated child records, my general approach is:
- Start by setting a user specific UUID value in the working table, using the Unique Identifier special value
- Build the initial form out on top of the working table, using a details screen with all input components writing to user specific columns
- On initial submit, add a row to the master (parent) table, using the generated UUID as a record ID
- Reload the same screen (show new screen->this item), and present the secondary form for adding child records.
- On submit, write the same UUID value in a “parent ID” column to establish the link from the child record to the parent.
- Rinse, lather, repeat for as many child records as are required.
An alternative to the show new screen->this item step can be to stay on the same screen and use visibility conditions to hide/show components based on the stage in the process. But that can get a bit cumbersome and difficult to manage.
3 Likes
Although creating a custom form is very powerful, I think in this case, it might be easier to use a native form, but instead of a 2nd screen for the form, just add conditions for the components that should show based on the category screen value. Once a user selects a category, then only the components that they need to fill will show on the screen.
3 Likes
mmm, having re-read the original question now I have to agree.
It’s amazing how you can read something and think you understand it, and then come back some time later, re-read it and realise that your original understanding was way off. The human mind is a never ending mystery.
3 Likes
I’m thinking of a problem with this, saying you choose category A and it has values from columns A, B, C, you fill those columns, but then backtracked to choose category B instead.
With category B, you don’t have an option to add values for columns A, B or C but as you have filled them on the same form already, if you submit, the data for category B will have values for columns A, B, or C.
While it might not be a problem on the front end, I like the cleanliness of the data in the backend, so that’s something to think about.
3 Likes
I like how this sounds, but I would like to have the user tap a button to initiate the showing of specific fields. Can I do that with the “ADD MORE DETAILS” button that I have in the UI? I am assuming I would need to create a “new” Action to do this…?