I have created a repeating group toggle-type menu that sets a state (called Genre Button) based on the app data source (Genre) for the repeating group. I am wanting to change the background color based on the state’s specific content, but am not able to enter that into the conditional formatting.
I want to say when [pagename]'s Genre Button is Action (action is one of the items in the Genre data)… but when I type action (or drama or any of the other genres) It doesn’t work.
Thanks. Sorry for the lack of clarity. I mean when I type action and press enter. it is red and doesn’t save/work/do anything. If I click out of the box, the word I typed disappears
Ok, so there’s your answer - you can’t give a ‘text’ value if the value needs to be a datatype (a Genre).
You need to refer to an actual specific ‘Genre’ (DB entry) - either by referencing a datasource on the page, (i.e. Group A’s Genre), or by doing a search for Genres and selecting a specific entry. (e.g. search for Genres, who’s name is Action, first item).
One last question for another implementation. In a workflow, can I manually set a state to be a specific name in Genre? When I set state and then do a search for genre whose name is action, it doens’t seem to work.
I’m trying to do a simlar thing I have set up for the repeating group with buttons that come from a search for genres but with static buttons. Basically an “Action” button that is static and always sets the state of “genre button” to be Genre’s Name is Action
Yes, you can set the value of the state in a workflow, using the same method (search for Genres, who’s name is Action, first Item).
Although if your Button is inside a repeating group which (presumably) has a content type of Genre, then all you need to do is set the state to be the current cell’s genre.
Another thing that you might want to look into is using Option Sets for this instead of database entries.
It looks as though Option Sets are perfectly suited to what you’re trying to do (but without knowing more about your app I can’t say for sure).
But using option sets would simplify the process, and make it faster, as there’s no need to do any database searches. So it might be worth looking into.
You could also store the colour on the Genre (whether you use option sets or stick with database entries), then set the background colour dynamically to be the state’s Genre’s colour. That way you don’t need to use conditionals to set the background colour.
I can’t seem to get the commands you mention to come up when I’m setting this state. see screenshot. There was no “is” so I used “contains” and then there is no first item. See screenshot below:
Make sure you click in the actual input box, and not on the ‘click’ button (which will just open the dropdown of expressions). As long as your name field is a ‘text’ type you should be able to type it’s value.
Additional note: also be aware that searches are case sensitive - on some of your earlier posts you were typing ‘Action’ whereas on the last post you typed ‘action’.
These are different values, so you’ll need to make sure you use the one that matches your data entry.