A person visits my page and fills out a bunch of information (all on the one page), some of which saves by auto-binding.
There’s a lot of clicking of text elements and buttons that shows and hides various groups on the page. I’m using ‘parameters’ and ‘go to page’ and conditionals with ‘get data from url’ for this (I’m not sure, but this seemed to be a slightly more elegant option than simple shows and hides).
At the end of all of this, I’ll give them the option to create an account so they can come back to work with their data in the future.
My question is: How do I attach all of the inputted information to the user, both before and after they register? I’ve done the lesson ‘Defining a field as a list of things - Attach a list of things to the current user’, so I know how to create a bunch of shopping list items and add that as a list of items to the user, but what if each item in that shopping list needs to have several fields associated with it, e.g. a) Item, b) Color, c) Weight?, an array within an array, I suppose (Edit: I think what’s also throwing me off is the ‘Items’ get created first, before the user has registered, and then after the user has registered, they add the ‘Colors’ and ‘Weights’ to those items).
(Along with that, I can’t figure out if I should assign a data type to the page or not. At first, it seemed like a good idea, but it doesn’t seem to jive with all of my ‘go to page’ stuff, because every time users click a button, which I’m using for ‘go to page’ navigation, the pages expects that data that I don’t feel particularly inclined to give it.)
Sorry for the length - thank you in advance!
(I would give you access to my editor, but since I haven’t been able to get my head around this, there’s not much to show you
I wanted to update this in case anyone has the same questions…
Here’s what I learned. A temporary user gets created and you can assign data to them. I had read that before, but I didn’t see the user in the database, so I was confused. In the end, it seems that the user is there, just not visible in the database until they register.
Anyway, the broad overview is that even before the user registers, you can run workflows that ‘Create a new thing’ and then ‘Make changes to user’ to add that thing to the user. Then when the user registers, those things will already be tied to that user.
Alternatively (and/or additionally), before the user registers, you can ‘Set state’ to add things to (and remove things from) custom states, and then when the user registers you can add those things to the user.
I ended up doing some of each - I added some things directly to the user before they registered, which meant I didn’t have to do anything special when they registered (because the data was already added to them), but I also added some things to a custom state which I added to the user (Make changes to user) after registration. I did that to decrease workflows because that really speeds things up. I now tend to think that reducing workflows is a good thing, because a lot of times a workflow will take 1-3 seconds to run, which is too much a lot of the time. That’s why custom states are so helpful, especially when it comes to creating lists of things.
This was simple in the end. You can create the thing first and just ‘Make Changes to thing’ later to add more data to it.
I didn’t end up assigning a data type to the page. Not sure if that will ever come in handy, but it hasn’t been necessary yet.
I’ve watched it twice and I’m sure I’ll get it eventually, slowly, with lots of pausing, and a stiff drink.
Update: 20 mins later a large light bulb turned on. It helps if I think of Set State as ‘save this thing to an imaginary temporary database.’ I can then have the page/group start with any kind of thing from my database in the imaginary database, then add to it, remove from it, and save it back to the actual database later on.
I’m clad I found this.Really helpful.On another thing altogether, I have this complicated workflow to show and hide a group on a repeating group.So it acts like a toggle like your colors. It is just a group and is not in the database.Is there an easier way to do this?