Select to view content in your preferred language

Get Coded Domain Values From Survey123

725
12
Jump to solution
05-13-2025 04:04 PM
LeviCecil
Frequent Contributor

I set up a custom Enterprise 11.3 connector to use Survey123 triggers in Power Automate. I'm running into what seems to be a perennial issue: coded domain values. I'm writing new S123 submissions to Google Sheets, and the domain codes are transferring over, not the values. For instance the Site ID instead of the Site Name. I know there's a get coded domain values connector for Enterprise, but there isn't one for S123. Is there a calculation I can do on the field to get the domain value?

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

jr:choice-name()

Used for select_one questions. It returns the label associated with the name of the choice in the given question. Be aware that the question must be defined inside quotes.

Example:

jr:choice-name(${select_one}, '${select_one}')


Used for select_multiple questions. It returns the label associated with the name of the choice in the given question. The selected-at() function must be used to extract the label for individual answers. Be aware that the question must be defined inside quotes.

Example:

jr:choice-name(selected-at(${select_multiple}, 3), '${select_multiple}')

- Jen

View solution in original post

0 Kudos
12 Replies
JenniferAcunto
Esri Regular Contributor

jr:choice-name()

Used for select_one questions. It returns the label associated with the name of the choice in the given question. Be aware that the question must be defined inside quotes.

Example:

jr:choice-name(${select_one}, '${select_one}')


Used for select_multiple questions. It returns the label associated with the name of the choice in the given question. The selected-at() function must be used to extract the label for individual answers. Be aware that the question must be defined inside quotes.

Example:

jr:choice-name(selected-at(${select_multiple}, 3), '${select_multiple}')

- Jen
0 Kudos
LeviCecil
Frequent Contributor

OK, thanks. I added a calculate field called "Dayname." Now I need to figure out how to bring in this field to the Power Automate flow. It's not listed in the dynamic variables. 

s123.PNG

s123_2.PNG

0 Kudos
JenniferAcunto
Esri Regular Contributor

You are using a calculate question type without a label value, so that value is not being retained or stored in your data. I would make it a text field with a hidden appearance.

- Jen
0 Kudos
LeviCecil
Frequent Contributor

OK. I set the field type to text, hidden with a label "Day Name". The bind::esri:field type is set to null. I'm able to successfully republish but it's still not showing up as a dynamic variable in Power Automate s123_3.PNG

0 Kudos
JenniferAcunto
Esri Regular Contributor

Setting the field type to null is just the same problem. You are not storing the value anywhere, so it ONLY exists in that survey and once it is submitted that value disappears. 

- Jen
0 Kudos
LeviCecil
Frequent Contributor

OK. If I set it off null, it tells me that there is no field called Day Name in the feature service and won't publish.

s123_4.PNG

0 Kudos
JenniferAcunto
Esri Regular Contributor

You are using your survey with an existing feature service, so you need to add the Dayname field to the layer first and then republish your survey. 

- Jen
0 Kudos
LeviCecil
Frequent Contributor

That seems pretty redundant

0 Kudos
LeviCecil
Frequent Contributor

I added the field dayname to the feature service and added this variable in Power automate. It's coming in blank in Google Sheets. My calculation is jr:choice-name(selected-at(${dayofweek}, 3), '${dayofweek}')

The raw outputs of the S123 connector all have the domain codes. In this case dayofweek is 3, but dayname is null

 

pa.PNG

0 Kudos