When I click the button ‘Follow’, I want the text to be replaced with new text that says ‘Following!’. As it is now, when the Follow button is pressed, the new text on the button appears briefly, then the button reverts back to the old text.
Here is the link in the public editor. Go the Preview mode to see the button’s behaviour:
You have to store this state as a field on a “Thing”. So the button triggers a workflow that sets the state. In the conditional tab, you create a condition to check if this field is set to true or false.
Hey @R.Galbraith If you’re trying to create an app where users can follow-unfollow others, you would want to store who the User is following as a field.
To set this up, you could add a new field within the User Data Type called “Follow List” (Type: Users, List: Yes).
So if a User navigated to that page and clicked on that button to Follow another User, the event in workflow would be:
"When Button Follow is clicked and when Current User’s Follow List doesn’t contain Current Cell’s User → Make Changes to a Thing → Current User → Field to Change: Follow List ‘add Current Cell’s User’.
Back in the UI Editor, on that button you could create a conditional statement which said:
“When Current User’s Follow List contains Current Cell’s User”
Text = Following! (or… have it be ‘Unfollow’)
Then have another event in the workflow which said:
"When Button Follow is clicked and when Current User’s Follow List contains Current Cell’s User → Make Changes to a Thing → Current User → Field to Change: Follow List ‘remove Current Cell’s User’.