Hi,
Really need help with creating new data entry.
I would like to create a new data collection that has defined 3 Text fields - Name, Color, Size
I know how to do it when I have One button that creates a new thing in the database and takes 3 inputs as a reference but how can I achieve the same result when I make inputs in a sequence?
See below example:
When I did this I got 3 different databases created. I know I should use an Action “Make changes to a thing” but I can not figure out how to set it up correctly.
Any suggestions on how should it be set up?
Would appreciate any help!
If, by ‘Next Page’, you actually mean you’re loading a new page, then you’ll have to store the input values somewhere…
That could be directly in the database, in session/local storage, or just in the URL parameters…
If, as I would more reasonably assume, by page you just mean some other ‘screen’ on the same page, then there’s no need to treat this any differently than you would if they were all in a single form/screen…
Unless you’re clearing the inputs or resetting their parent groups, the inputs will still hold the values entered into them - so just access them as normal.
If you are clearing the inputs, the you’ll need to store the values first - and if you’re doing all of this on a single page, then just use custom states for that.
1 Like
Thank you Adam for your quick answer!
As you mentioned it would be easier to just do it on the same page.
I would like to have Input 1 changed for Input 2 on the same page (after filling in Input 1 and clicking next) - how would you approach it?
I’m thinking about hiding and unhiding Inputs after the button clink, but maybe I’m overthink it…
Well, of course it will entirely depend on your intended UX/UI…
But there are two ways you can to this…
First (perhaps the simpler option, although not as efficient), is just to have 3 input elements, with only one at a time being visible, based on a custom state value.
Then simply change the custom state value when the next button is clicked (to show/hide the next input), then at the end just Create a Thing in the database and map each input value to the correct field.
Another option, is to just use a single input element. When next is clicked, store its value to a custom state and reset the input. Then at the end just Create a Thing and map the custom state values to the correct fields.
1 Like
Can’t thank you enough! You made it all clear to me 
Wishing you all the best!
1 Like