Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have made multiple buttons, one for each month and I want them to light up when they're selected.
I can make them change colour when a single month is selected but when selecting multiple months they all return to default colour. How do I make them change colour when multiple months are selected?
Currently using : - Toggle Field Selection (Action)
Appearance Expression: =IF([Reporting Period (Month)]='01 JAN',Green(),) 02 FEB, 03 MAR, 04 APR....etc
Many thanks
If you want to highlight specific month only, you need for each button make separate expression to check, does month exist in selection. It can be done with something like this:
if(index(GetFieldSelections([Reporting Period (Month)]), 'JAN')>0, green())
'JAN' in other buttons should be changed to 'FEB', 'MAR' etc
Hi, try
if(GetSelectedCount([Reporting Period (Month)])>0, green())
Thanks for your help. It sort of works, however it changes the colour of the button even if that current month isnt selected. In the picture below March is selected but Jan is changing colour without it being selected.
If you want to highlight specific month only, you need for each button make separate expression to check, does month exist in selection. It can be done with something like this:
if(index(GetFieldSelections([Reporting Period (Month)]), 'JAN')>0, green())
'JAN' in other buttons should be changed to 'FEB', 'MAR' etc
Thats perfect thanks!
Just another small thing - When I select over half of the filters the colour swaps to as if they're not selected when they are. Do you know why? In the second photo all the blue are selected do you know how to keep them green instead of swapping for what ever reason
hmm, this is nuance of this getfieldselection(). If you select more than half possible values it shows not 'jan, feb, mar...' but 'NOT sep, oct, nov, dec'. I didn't know that until now too 🙂
Lets make 'string' if month is selected:
if(GetSelectedCount([Reporting Period (Month)])>0, Concat(total [Reporting Period (Month)]))
so a bit modified expression could look like
if(index(if(GetSelectedCount([Reporting Period (Month)])>0, Concat(total [Reporting Period (Month)])), 'JAN')>0, green())
Thats excellent fix this issue thank you very much!