Hi community,
I want to use choose instead of nested if to display status text in different colors.
I tried this expression and it throws this error A grid column [label=“Status”] has encountered an error. Expression evaluation error at function 'choose' [line 58]: Invalid index (1) for list: valid range is empty.
choose(wherecontains({fv!row[aRecord.status]}, cons!STATUSES)[1],"SECONDARY", "SECONDARY", "SECONDARY", "POSITIVE", "NEGATIVE", "STANDARD")
what am i doing wrong here?
Kind Regards,
Erik
Discussion posts and replies are publicly visible
Hi Erik,
Have you checked the result of wherecontains() first to check whether it is returning the correct value?
Yes, the code "wherecontains({fv!row[aRecord.status]}, cons!STATUSES)" should be first run by itself to make sure it returns a valid value.