That page has 5 repeating groups. Each group is a different category of hobbies/interests.
E.g… : hobbies (singing, reading, …), water sports (swimming, rowing, …), languages (german, spanish, …)
So there are lots and lots of these “interests/hobbies” in total.
What I want:
default: grey button (or orange if that specific interest/hobby is part of current user’s interests list)
when clicked: turns orange and interests/hobby is added to current user’s interests
when clicked again: buttons turns grey again and interest/hobby is removed from current user’s interest
Currently: works! BUT it is veeeery slow. Every single time something is clicked it of course changes the current user’s data. Users are finding it very painfully slow.
So I was thinking: states. click = “selected state:yes/no”
Once the user clicks a “save” button, all the states that are “yes” will be saved into the user’s profile. BUT Apparently I can’t reach into the repeating group to get these states specifically for each repeating element.
How can I achieve what I want without it being painfully slow?
I thought of URL states, but can’t seem to get the hang of it
Yes, exactly.
The user has a list of languages and a list of interests. And the buttons change from “selected” to “unselected” according to conditional “if current user’s interests contain current cell’s interest’s name, then colour=orange”
Every repeating group is made up of repeating elements one circle with an overlaying image. I tried buttons but couldn’t put my icons properly on it. And states as I mentioned don’t seem to work in this repeating group scenario.
In both cases, it’s using the same database for the image. As an image (just overlay over a circle shape) it works and shows the picture correctly. As an image “within” the button it suddenly just shows the path, not the image… Even tried switching data files - still doesn’t work. Seems it only displays text on a button and not images.
Icon with round shape instead of button doesn’t work because I can’t seem to upload my own icons. Hence, I’m stuck with circle + image solutions.
Hey @AlexDaresTo, buttons do take only text. You can use a group with the background set to image and the border roundness pushed way to get the image effect though.
I’ll log in to your site this evening (EST) but can you upload a screen shot of the workflow that you are using to add these interests to the user? And are the interests another thing or just text?
And here’s the current workflow. I have always both versions as you can see. X happens when button is clicked but only IF Y. When I had the whole thing in one workflow only, it just didn’t work.
and when “current user’s interests doesn’t contain current cell’s interest’s name” then of course it’s “add” instead of remove.
I tried this, having it in one workflow only instead of 2, but that didn’t work. Presumably because it added and right in the next step removed, I guess. So went back to the other version I posted above. Slow, but at least it works.
Hey @AlexDaresTo, my apologies. So one thing you could do that should speed this up quite a bit is using a state as you mentioned. This way you are only making changes to something in the browser and not updating the database every time your user selects an option.
The way this could work is you create a state on the page that is a list of texts called Selected Interests. On page load, simply set the Selected Interests state with the Interests saved to the current user.
At this point, instead of modifying the user when options are selected/deselected, modify the Selected Interests state using the same logic you are currently using to modify the Interests on the user. Then when the user clicks to save changes, make changes to the current user like this “Interests set list Selected Interests”.
sooo much faster and easier now!
Took a bit playing around but with another tutorial in a different forum post I was able to figure out the state settings. Now using “:plus item” and “:minus item” with the states :)))
Thank you, Eli!!