Select to view content in your preferred language

Creating a singular priority field in a Survey to aid in Dashboard category creation

728
3
03-05-2024 08:35 AM
riddlz
by
Emerging Contributor

Hi, 

Wondering if anyone knows of a method where a common field could be used to assign priority to question fields in Survey123. By assigning a priority to questions, submitted survey entries with answers to specific questions could be grouped by varying priority in a dashboard.

For example, if you have a select_one yes_no question " Is the road passable?" with the answer as no, it would be defaulted to high priority. By assigning a priority to questions from a single field, question fields in Dahsboards could be grouped by their priority. This would allow for trending/tracking of questions/incidents by priority grouping. 

After reading this post , I see how a field could be added the HFS of the survey, however this would mean that I would have to manually add priorities to questions after a survey is submitted since the survey schema would not have this field built in. I've also built a test survey (xlsf attached) where I explored adding a priority column to the workbook, however when published there is no means to call on this column (expected, but still wanted to test). In the test survey, you can also see how assigning a priority to each question creates a new priority field, when a single priority field that spans all questions is desired. 

Any guidance on this is much appreciated! 

 

 

0 Kudos
3 Replies
abureaux
MVP Frequent Contributor

Adding a column here won't add anything to your Feature Layer (and may negatively impact your survey). I would not recommend doing this.

abureaux_0-1709670089179.png

Adding a row here will add a corresponding column to your Feature Layer. This is the indented workflow.

abureaux_1-1709670126960.png

You need to determine how an item's priority is set. Typically, you would use some type of logic in the form. E.g.,

  • Your ${example_priority} field could allow the user to select priority manually (that kind of looks like what it is already doing). You could use this manual priority in you web map/dashboard; or
  • A calculate could be used to automatically generate a priority based on previous inputs. maybe something like
    abureaux_2-1709670367863.png

     

riddlz
by
Emerging Contributor

Thanks for your response! 

I understand how to add a priority question (calculate, select_one, etc), however I am looking to assign a priority value from a single field to multiple questions. By adding a calculate type priority question after every select_one question, I would be creating multiple different priority fields (since question names cannot be identical), making it impossible to group questions by priority in a dashboard setting (cannot group questions by multiple fields). 

It's easier to explain if I organize the questions in a table like this: 

riddlz_0-1709731895725.png

Any help with this is much appreciated!

0 Kudos
abureaux
MVP Frequent Contributor

You can have a single calculate with more complex IF statement to determine priority. Take a look at my example above. The calculate is essentially using two different questions to determine priority. You can effectively have as many criteria as you'd like.

Then, that calculate's priority would be applied to the survey as a whole.

You can't really assign a secondary value to questions. E.g., if you have a select_one and the user selects "apples", you can't also behind the scenes have a second "fruit" value attached to that select_one directly. You'd have to have a separate field hold onto the "fruit" variable.