Is it possible to change text color based on certain conditions?

553
2
04-06-2019 04:30 AM
Highlighted
New Contributor III

I have a number of groups on a page, and they all start out closed using the 'compact' appearance.  I would like the font color of the group title to change based on whether all of the questions within the group have been answered.  Is that possible?

2 Replies
Highlighted
Occasional Contributor II

It doesn't look like you can put If statements within a group name, so changing the text colour dynamically probably isn't possible.

One workaround you can try is to use note fields that come after each group. Using the string-length() function, you can easily determine if a given question is answered or not. For example, writing string-length(${question})>0 in the relevant column will make a note or other question appear only when the referenced question has text entered or a choice selected.

I'm attaching a form that uses two methods of recording this and displaying it with note fields. One method is a simple "all answered" vs "all unanswered" relevancy. The other method will actually display the number of answered questions as the user fills out the group. Take a look and see if either method may help you with what you're looking for.

Highlighted
Esri Esteemed Contributor

Hi Andrew,

As Nick mentions, Survey123 doesn't currently have support for this (or another method of providing an indication of question completeness).  I've added this to consider as an enhancement in the future - could I ask that you post this in https://ideas.arcgis.com to provide a place for others to register their interest?