It looks like you’re navigating between pages here…
Custom states only exist on the page and will be cleared anytime the page reloads, so if you’re using a ‘go to another page’ action the the header custom state values will be cleared when your user goes to the new page.
Which explains why nothing is saving (i.e. the header custom state values will be empty).
There are a few different ways to do what you’re trying to do…
The simplest way (in my opinion), and also probably the best UX, is not to use multiple pages for this at all (unless you have a specific need to). Rather just keep the user on the same page, and use separate groups for each step in the process, showing and hiding the relevant groups as your user moves through the sign up process.
Not only will that be much faster than navigating to a new page and waiting for it to load, but there will be no need to use any custom states at all, as you can simply refer to the relevant input values at the final stage.
If there’s a particular reason you want/need to use multiple pages here, then you’ll need a way for each subsequent page to access the data from the previous page (as I said above, you can’t use custom states for that).
There are basically 3 ways to do that:
- Through the database
- Through URL parameters
- Using cookies
To be honest, the simplest method would just be to create the object in the database, and modify it as the user goes through each stage, although you specifically said you don’t want to do that.
In which case the best option will be to send the data through key/value pairs as URL parameters, then read the data from the URL parameters in the subsequent page using ‘Get Data From URL’.
So there a several options for this, but custom states aren’t one of them unless you opt to keep everything on a single page (in which case you won’t actually need any custom states at all).
If it was me, I’d use a single page, as it keeps things simpler, and faster - but if you want to navigate through multiple pages, without saving anything in the database, then using URL parameters is your best option.