Printing Template Survey123

1814
10
07-15-2018 04:29 PM
AnuSawant
Occasional Contributor II

Hi,

In my survey I have a result field showing choices as "Low,Medium, High" and I have added an individual color to these choices. So in my choices list under "label" I have added these as:

<font color='green'><b> Low </b> </font>
<font color='orange'><b> Medium </b> </font>
<font color='red'><b> High </b> </font>

When I have tried printing  the report using by default Survey123 template it is showing me correct result as:

Low

Medium

High

But it is not showing me the same result above if I used my customized template. My result is the value I have added under "label" above. If I am not wrong the result should be printed same even if we used customized template.

Can anyone guide me about this?

Thanks,

Anu

 

0 Kudos
10 Replies
ClaireProctor
Occasional Contributor

Hi Anu,

Customized report templates don't support HTML formatting (in fact, it's news to me that the default template does), so that's why your results aren't being formatted in the same way.

Version 3.0 did introduce conditional statements, though, which should let you replicate the formatting in your report template. You can find the formatting to do this in the documentation: Print survey results—Survey123 for ArcGIS | ArcGIS 

In your case, although I don't know your actual survey setup, something like this would list the 'Low' result as you have it in your survey (know that in most cases, select ones will be looking for the choice's label rather than the choice's name):

${if priority==”<font color='green'><b> Low </b> </font>”}Low${/}

Repeat similar for all of your other results. You'll probably need to experiment to get the functionality and formatting that you want.

0 Kudos
AnuSawant
Occasional Contributor II

Hi Claire,

Our client want that options to be colored in the template so it will stand out. I have checked this in the default Survey123 printing template first so thought it will work into the Custom template, but pity that its not the same.

Unfortunately this field is base on visual inspection and is not depend on any of the fields in survey (I know it would be easy to color code it if it depend on some other field 

 Thanks,

Anu

0 Kudos
ClaireProctor
Occasional Contributor

The example I gave should do the job, since we are still talking about a field in your feature service. Essentially, rather than actually display the value in the field, it shows and hides text based on what the value is. Just replace the field name 'priority' (I just guessed what the context of the question was there) with your field's name, and it should work.

0 Kudos
AnuSawant
Occasional Contributor II

I am still trying to figure it out, but seems I am missing something. So far what I have done is:

1) I have used this ${if priority==”<font color='green'><b> Low </b> </font>”}Low${/} and rename the field name to ${if presence==”<font color='green'><b> Low </b> </font>”}Low${/} I did that for the rest two options.

2) I have added all three updated statement in my word document but when I was trying to print the report it is not downloading the result. With the new changes in printing tab I am trying to see where is the error but cant find it out.

0 Kudos
ClaireProctor
Occasional Contributor

I'm not sure what caused that error, but it probably wasn't the conditional statement. It looks like it might have just stalled at 'Printing', which is the first of about five steps. Error messages appear if a survey actually fails and a 'More Details' link appears in the box.

The best I can suggest is just to retry and see if it happens again. I'm not sure if this is a known issue with the new printing setup or not.

cc: Zhifang Wang

0 Kudos
AnuSawant
Occasional Contributor II

I have tried it couple of times and the output is the same. Can someone help about it?

I guess its syntax - see details below. 

Thanks 

0 Kudos
JamesWilson2
New Contributor III

Hi Claire,

I filed a similar issue in https://community.esri.com/groups/survey123/blog/2017/07/26/introducing-custom-form-report-templates... at the end of last year and James said he had filed it for correction, any idea if that was actioned? The conditional formatting gets around it, but is a lot of work to build the templates for big surveys or for questions with lots of answers.

0 Kudos
LeilaJackson1
Occasional Contributor III

I am having this same issue. I have html code for my labels  (e.g. <b>No</b>)  in my Survey123 Connect form, the data looks fine in the AGO attribute table, but when I pull it into a Survey123 customized report template and run the report it is showing up as the label  (<b>No</b>)  instead of the name. I just want the response, and don't care whether it is bold or not. Has there been any resolution to this? Thanks!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Leila,

It isn't possible to directly remove the HTML associated with text; that being said, if this is the label for a choice, you could use the ${q1 | getValue: ""} syntax to retrieve the name (domain code) value of the question, which likely does not have HTML.