Survey123 div style conditional formatting

142
2
Jump to solution
09-30-2022 01:40 PM
JoelRogers
New Contributor III

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:

namelabelcalculation
CURRENTLANEWIDTHCurrent Lane Width 
LANE_WIDTH<body bgcolor=${fieldBG2}><font color="black"><b>Lane Width (${CURRENTLANEWIDTH} ft)</b></font></body> 
changeDetect2Change Detectionif(${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.

namelabelcalculation
CURRENTLANEWIDTHCurrent Lane Width 
LANE_WIDTH<div style="font-weight:bold; color:#000000;background-color: ${fieldBG2}";>Lane Width (${CURRENTLANEWIDTH})</div> 
changeDetect2Change Detectionif(${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?

1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Colors.gif

 Epic XLSForm attached.

View solution in original post

2 Replies
IsmaelChivite
Esri Notable Contributor

Colors.gif

 Epic XLSForm attached.

JoelRogers
New Contributor III

@IsmaelChivite This works for me. Thank you.

0 Kudos