[SOLVED] Button to go to next database record?

I have a data type called Step and a field on the User called Current Step.

How do I make it so when the user clicks a button, their Current Step becomes the next step in the Step data type? The Step data type has a field Number that allows me to change the order of steps when necessary, so I’d like to go off that for deciding which step comes next.


Don’t know if this suits your case but if you store the steps as a list and display them in an RG with “fixed number of cells”, you can use the “show next” action. You could sort the RG dynamically by “Current users step”. If a user has completed a step, constrain the RG to only show ‘current users steps left’.

How about…

On the button click update the user and set current step to > search for steps with constraint where the step number field = current user current step + 1

EDIT and remember to take : first item

@jaos.pcl This isn’t what I was thinking but after the initial slight pain of setup, it makes things much more efficient. Thanks!

@mebeingken Good idea. I went with the RG method, but yours seemed to have promise, too. Thank you! Update: Actually, I ended up using your suggestion, too, so when the user comes back to the site later, they start off on the same step they were on before, so thanks!



The previous button is the same but I had to do minus 1 instead of plus 1.