Hi there,
First time posting on here. I keep running into what seem like limitations with the software but I am determined that there must be a work around.
I have several Survey123 surveys which have multiple choice questions. The outputs from these questions are in a string e.g., 'banana, orange, apple'.
What I would like to do is create a pie or bar chart in ArcGIS Dashboards to display the number of times each choice in the multiple choice was individually selected across all submissions e.g., banana = 34, orange =26, apple = 54.
I have recently discovered New Data Expression section in Dashboards and feel this must be the way.
Can someone confirm this is how it would be done? If so, I will provide the details of my survey and would really appreciate some help with the code.
Thanks in advance.
When you open the builder to create a data expression, there is link to several sample data expressions, including this one that handles the Survey123 multi-selects. It says it's for use in pie charts, but you can just use it in a serial chart just fine.
You will need to make a few updates to work with your data.
1. If you are using ArcGIS Enterprise, use your enterprise URL
2. From top to bottom, survey data layer item id, survey data layer layer id, multi-select field name
3. Multi-select field name
Thank you for answering my question so swiftly! I have already tried this but I am not sure why it doesn't work for me - maybe you can help me debug and work out what I am doing wrong?
A couple questions to make sure I am doing it right:
1. the only things I need to change in the example code are the Portal (you highlighted as 1), FeatureSetByPortalItem (you highlighted as 2) and the field name (you highlighted as 3)?
2. Portal - mine should also be 'https://www.arcgis.com' because it is a feature layer hosted on ArcGIS Online?
3. The FeatureSetByPortalItem should be the hosted feature layer not any other layers or views as pictured in the attached screen shot showing form 'feature layers'?
4. The FeatureSetByPortalItem should be taken from this the URL highlighted in image 'FeatureSetByPortalItem'?
5. The FeatureSetByPortalItem is the section in bold in this link below?
https://services-eu1.arcgis.com/LgIVKFtcUmoHs3mV/arcgis/rest/services/service_f1156eb85ed043e48b60d5167342bdbc/FeatureServer
6. The field name should be 'why' see attached image of 'multiple choice question output' & 'multiple choice name of field'
Thank you for your help - I hope you can help me to get this to work.
The errors shown in images relating to error 1 and 2. If you would like me to copy and paste script let me know.
You can get the item id from the survey data Item Details page. It can be found in the page URL or by expanding the details panel on the right.
Hi Jen,
Thank you so much! This is working now! Really appreciate your help, I have spent a long time trying to find other work arounds!
Thanks,
Miriam
Use 'Sum' as your statistic in the chart instead of 'Count'.