On my index page, I have three buttons for a role the user can play in a chatbot roleplay.
Rather than create a chatbot page for each role, I want to use a generic chatbot page that adapts to reflect the choice made by pressing the button.
So if the user chooses A, the chatbot page shows text related to A. If they press B it shows text related to B. It also use the choice to select things from a the database, so I only need one database not three.
As I understand it custom states are within pages, so I cannot use them to pass the choice from the index page to the chatbot page.
So I thought I would add a field to the user database named something like āmodeā but I cannot figure out the simple job of setting a value for that field when the button is pressed.
Iād be grateful for your advice to find a solution.
To set a database value when a button is pressed just use a āMake changes to thingā action, and set the required field value on the required thing.
That said, thereās probably no need to write to the database for this.
Simply using URL parameters would likely be a simpler and less WU wasteful option, or you can write to session storage instead.