Report Temaple experession to return select_one name instead of label?

456
4
Jump to solution
07-12-2018 04:15 PM
AdamInglis1
Occasional Contributor

I want to pull the name value from my select_one list into the Report Template instead of the label:

The label looks great in the Survey123 app:

But I need the actual DB value (i.e. '9') in the Report Template instead of the verbose label ('<b>9</b> - Very Good, New Condition')

Alternatively is there an expression that will pull a specific character into the Word Doc report instead of the full label?

0 Kudos
1 Solution

Accepted Solutions
ZhifangWang
Esri Regular Contributor

Hi Adam,

Yes, you can use ${fieldname1 | getValue:""} to get the raw value of an underlying field. For a string field with coded value domain, it will return the code, for a date field, it will return the Unix time.

For example, ${expertise} returns "None. I have never used it." (the name of the coded value domain) while ${expertise | getValue:""} returns "none" (the code of the coded value domain).

View solution in original post

4 Replies
Philip-Wilson
Esri Notable Contributor

Zhifang Wang‌ Can you please look into this and update user if it is currently possible? Otherwise can we create as possible enhancement request to use a parameter?

0 Kudos
ZhifangWang
Esri Regular Contributor

Hi Adam,

Yes, you can use ${fieldname1 | getValue:""} to get the raw value of an underlying field. For a string field with coded value domain, it will return the code, for a date field, it will return the Unix time.

For example, ${expertise} returns "None. I have never used it." (the name of the coded value domain) while ${expertise | getValue:""} returns "none" (the code of the coded value domain).

AdamInglis1
Occasional Contributor

Worked like a charm, thanks.  Where is the best place to find a listing of these functions?

Philip-Wilson
Esri Notable Contributor

Hi Adam,

You can find the supported expressions in the Survey123 Online Documentation: Print survey results—Survey123 for ArcGIS | ArcGIS 

Phil.

0 Kudos