I am working with several surveys that I need to enable conditional formatting on question backgrounds depending on whether the question equals another field or not. This works great in the past using a blog from Esri UK regarding body background tags (https://www.esriuk.com/en-gb/news/we-talk-tech/survey123-dynamic-colouring-and-advanced-summary-page). Now, as we all know, everything changed about how to use HTML tags within Survey123. In an attempt to update the workflow, I am changing the syntax from something like this:
name | label | calculation |
CURRENTLANEWIDTH | Current Lane Width | |
LANE_WIDTH | <body bgcolor=${fieldBG2}><font color="black"><b>Lane Width (${CURRENTLANEWIDTH} ft)</b></font></body> | |
changeDetect2 | Change Detection | if(${CURRENTLANEWIDTH} = ${LANE_WIDTH},'0','1') |
fieldBG2 | if(selected(${changeDetect2}, '1'), "#ff7373",if(selected(${changeDetect2}, '0'), '#5ac18e','#E7E7E7')) |
To this using div tags. Works great in the app, but the browser version fails epically.
name | label | calculation |
CURRENTLANEWIDTH | Current Lane Width | |
LANE_WIDTH | <div style="font-weight:bold; color:#000000;background-color: ${fieldBG2}";>Lane Width (${CURRENTLANEWIDTH})</div> | |
changeDetect2 | Change Detection | if(${CURRENTLANEWIDTH} = ${LANE_WIDTH},'0','1') |
fieldBG2 | if(selected(${changeDetect2}, '1'), "#ff7373",if(selected(${changeDetect2}, '0'), '#5ac18e','#E7E7E7')) |
How can div statements be used now with conditional formatting?
Solved! Go to Solution.
@IsmaelChivite This works for me. Thank you.