Survey123 Tricks of the Trade: Embedding a survey in an ArcGIS Dashboard

53703
79
04-27-2020 04:18 PM
IsmaelChivite
Esri Notable Contributor
22 79 53.7K

Updated August 10, 2023

Updated April 23, 2024 {globalId} to {field/globalId}

 

In this post you will find step by step instructions to help you embed a survey within an ArcGIS Dashboard. This is a commonly used used to support QA/QC and review workflows. The animation below illustrates what this could look like. In this dashboard, a list of mosquito spray exclusion requests is shown in the left panel. These requests are added through a separate online survey open to the public. A request review survey has been embedded in the right panel. As requests from the list are selected, the survey is automatically populated so the request can be reviewed and updated.

 

Embedded survey in a dashboard

 

The above example provides a compact user experience for browsing and updating existing data. This same idea can be applied to many workflows, where one survey is used to submit jobs or requests of some sort, and a dashboard with an embedded survey is used to review the incoming information.

 

If you would like to give the above sample application a go, you can try it live:

 

 

In this scenario, you need two surveys targeting the same feature layer. One survey is used to submit requests, and the other to review them. The surveys share a common set of questions, but they are not exactly the same: the request review survey, for example, has an extra section to approve or deny the request. Generally, the surveys are also shared differently: the one to submit requests is shared with a group of people, even with the public, whereas the survey to review requests is shared with a smaller group.

 

Assuming that you already have the survey you want to embed into your dashboard ready to go, and that you are somewhat familiar with ArcGIS Dashboards, here is a step by step guide to get you going:

 

  • Before we start, make sure your dashboard has a Map element and that the web map in it has a refresh rate set.
  • In your ArcGIS dashboard, add a List element and configure it to target your survey layer. You can apply a filter to this list in case there are survey records you do not want to show. In our example above, a filter could help us hide any request that has been already been approved and closed. You can also use the sorting options in the List element to present the most relevant records at top of the list.
  • Next, add an Embedded Content element.
    • In the Data Options panel, first set the Type to Features and target your survey feature layer.
    • Paste the URL of your survey web form into the URL property.
    • Set the Maximum Features Displayed property to 1.

Configuring embedded content element in the dashboard (1)

At this moment, a preview of your survey should be shown in the right panel. Next, we are going to modify the URL with some extra parameters to load content and adjust the look and feel. If you are not familiar with the Survey123 web app parameters, check out https://community.esri.com/groups/survey123/blog/2019/02/06/survey123-tricks-of-the-trade-web-form-u... and https://community.esri.com/groups/survey123/blog/2019/05/24/survey123-tricks-of-the-trade-editing-re... 

 

  • Right at the end of the URL you just pasted, add the following:
    • ?mode=edit&globalId= If using a survey from ArcGIS Online
    • &mode=edit&globalId= If using a survey from ArcGIS Enterprise. (This should include the portalUrl parameter before. Ex.  https://survey123.arcgis.com/share/<itemID>?portalUrl=<portalUrl>&mode=edit&globalId= )
  • Use the fields collection to add the GlobalID variable into your URL.
  • Optionally, add the following parameters to hide the navigation bar and footer: &hide=footer,navbar

 

The following animation shows the last three steps.

Note (April 2024): In the most recent version of ArcGIS Dashboards, the GlobalID field is referenced as {field/globalId} instead of just {globalID}.  Be aware!

 

Configuring embedded content element in the dashboard (2)

 

 

  • Save your changes and go back into the dashboard design.

 

At this moment you have the List, Map and Embedded Content elements in your dashboard, but they do not talk to each other. We are going to configure actions to make them work together.

 

  • Open the List element configuration dialog and add a new filter action targeting the Embedded Content element

 

 

  • Optionally, you can also configure actions in the List element to zoom to and flash the selected record.
  • From the design preview, select an element from your list and wait for the embedded survey to load the corresponding record. Now you can make changes to the record and submit!

 

Common problems

 

If you get a "Leave site?" dialog every time you try to load a new survey into your dashhoard, add leaveDialog into the hide parameter of your survey url.  For example, from &hide=footer,navbar to &hide=footer,navbar,leaveDialog

IsmaelChivite_1-1692721357555.png

 

 

IsmaelChivite_0-1692721261311.png

 

 

Limitations

 

The filter action in the Embedded Content element can also be triggered from a selection in the map. However, it is not possible to configure your dashboard to trigger the filter from both the Map and List elements. That is, you need to choose either to load a survey from a selection in the list or from a selection in the map, but you cannot do both.

 

The Survey123 web app does not support editing surveys with repeats. You will get an error when attempting to initialize the form if it includes a repeat.

79 Comments
neomapper
Frequent Contributor

Why does the embedded feature break when you add 2 lists to 1 embedded feature? Is there anyway to fix this?

CPoynter
Frequent Contributor

Try placing one list in the Sidebar and the other in the Body of the Dashboard. 

RobertAnderson3
MVP Regular Contributor

Is there a way to set the layer in the list to update when there's an update to the survey? I have set up a survey using this for a supervisor to approve the submissions, but when they submit their data does not show up in the table until the dashboard is refreshed as a whole, it would be nice if the table widget could auto-refresh (there is no map element in this dashboard).

As well, since the survey is using repeats, I would like the 'query allowUpdates=false' parameter to work with web forms.

I set up a join and saved it as a hosted feature layer to be able to include the repeat data along side the original form, this is fine but a huge pain when I have to make a schema change to the survey form itself as then I have to re-set up the entire dashboard, is there a better process?

Thanks!

neomapper
Frequent Contributor

@RobertAnderson3 

Are you turning the refresh interval option on? 

neomapper_0-1678727008770.png

 

RobertAnderson3
MVP Regular Contributor

@neomapper I do have that turned on thinking it might work, and it doesn't seem to do much of anything for me? That refreshes the Arcade script but that script doesn't actually retrieve the data does it? Waited for 3+ minutes and nothing changed.

neomapper
Frequent Contributor

@RobertAnderson3 

Did you turn the automatic refresh rate on the feature layer it's self?

Open your feature layer> go to Visualization > Properties > Refresh Interval group (default is turned off.. turn it On) > Save 

neomapper_0-1678731489790.png

 

RobertAnderson3
MVP Regular Contributor

@neomapper I think the struggle I'm having is that I don't actually include a map in my dashboard. So I don't have the layer saved in a map for it to turn that on. 

DorothyThomas1
Occasional Explorer

@IsmaelChivite 

I've successfully used your method above to embed a survey123 form into a dashboard for editing on several occasions, and it worked perfectly.  I have a slightly differently scenario, and I'm wondering if you would still recommend using this workflow. 

I'm building a team availability roster. Each team member can only submit one record, but should be able to edit that record many times. They will only use a web form. And I'd like to use one URL for initial entry and survey update. 

I know the Survey123 publishing settings have changed, can I do this with a combination of publishing settings, or would I still need to build a dashboard, to enable a user to edit their survey data - only their survey online, as well as collect the initial survey.

#Survey123 #dashboard

anonymous55
Frequent Contributor

Hello

I have this URL which I want to embedding related survey to dashboard :

https://survey123.arcgis.com/share/xxxx?mode=edit&ParentGlobalID={GlobalID} 

But doesn't show me anything?

I follow the instruction for Parent table and it is working for editing existing data

https://survey123.arcgis.com/share/xxxx?mode=edit&globalId={GlobalID}

RobertAnderson3
MVP Regular Contributor

@anonymous55 From my experience recently you need to use the globalid of the form itself, no matter if you want to edit a repeat. It will let you know which section.

So for my case I set up a second form connected to the same feature layer as the original, and only included the repeat section that I want shown.

Then in the embed I use the globalid of the main survey layer but use the itemID of the second form I made.

I hope that very brief explanation made some kind of sense!

ZachBodenner
MVP Regular Contributor

Hi Ismael,

First of all thanks for the post! I'm trying to set this up and for the most part it works great except for one thing: when I switch the survey by clicking on the item in the list I always get this popup suggesting that a change will be lost, even if the survey hasn't been edited at all. Do you know why that might be? Is there a configuration that I could set to adjust it or a way to not make the survey editable right away after clicking a list item?

 

ZachBodenner_0-1692363631863.png

 

ArmstKP
Frequent Contributor

@IsmaelChivite I am having the exact same issue as @ZachBodenner  above.  When I have my survey form open in a dashboard with actions configured in the map, so when I click on a feature, it will open up the associated S123 survey.  The issue I am having is if I go click on another feature on the map to open up its S123 form to edit info, I constantly get this popup error about leaving the page.  Even if I don't edit info and click on a feature to open up and edit its form, I will get the popup to Leave or Cancel:

ArmstKP_0-1692381566195.png

 

ZachBodenner
MVP Regular Contributor

@ArmstKP  just an FYI I didn't manage to solve this in dashboards yet, but if your configuration can be replicated in Experience Builder, you might try that. I added mine to a side panel so users can choose whether they want the survey visible at any time. That solved the issue with the refresh (actually even before putting in the side panel, so that part is exactly necessary), plus you can set it up so both the map and the list trigger the relationship with the survey.

Side note do you work for Minneapolis Parks? That looks like a great app!  I'm a Minneapolis resident and I think that looks like it'll be really helpful!

IsmaelChivite
Esri Notable Contributor

@ZachBodenner @ArmstKP  I have been trying to reproduce the problem you describe without success. If you send an email at survey123@esri.com I will organize a quick call so we can look at this in more detail. I am curious to learn how to reproduce the problem. Thanks!

IsmaelChivite
Esri Notable Contributor

@DorothyThomas1  I am thinking this may help: Create a survey for people to enter the 'one' record.  Then, use either Make.com or Microsoft Power Automate to send an email to the respondent. This email will include a link to the survey in edit mode and targeting the feature that was just created. The respondent could go back to the email in the future and edit as many times as needed.

neomapper
Frequent Contributor

@IsmaelChivite  - We are also having this same exact issue where it will keep popping up over and over when new records are selected. This popup is probably one of our biggest complaints with the survey123 embed on a dashboard.

IsmaelChivite
Esri Notable Contributor

@neomapper  I hear you! 🙂  Please email survey123@esri.com so we can look at this in more detail. Looking forward to learn what is causing the problem so we can address it.

IsmaelChivite
Esri Notable Contributor

@ZachBodenner @ArmstKP @neomapper  To prevent the 'Leave Site?' popup dialog to appear, add the leaveDialog element to the hide parameter of the survey url.

For example:  &hide=navabar,header,leaveDialog

ArmstKP
Frequent Contributor

@IsmaelChivite Bingo, works like a charm!  Thanks for creating this fix so quickly!

Luiz_RobertoArueira_da_Silva
Occasional Contributor

Helô, @IsmaelChivite 

Segui seu tutorial, mas ao selecionar um registro da lista, aparece a mensagem: "A edição não é possível, pois o parâmetro globalId não é fornecido".
No entanto, verifico se o campo globalid existe na camada de formulário.
Quando configurei a ação de lista e optei por filtrar o conteúdo incorporado, não havia como escolher os campos de relacionamento, entendo que o filtro é automático pois o banco de dados é o mesmo.

Captura de tela 2023-09-01 154657.jpg

 

Captura de tela 2023-09-01 152132.jpg

 A URL inserida:

https://survey123.arcgis.com/share/19c53fb2f2f04c8eb551be3fd4b89d1a?portalUrl=https://meuportal/port...

Alguma dica sobre o que posso fazer para passar o parâmetro corretamente para o formulário?
Obrigado.

EdKnowles
Occasional Contributor

G'day @IsmaelChivite and team!

Is there a plan / time frame to allow editing repeats within repeats via the web app?

Thanks

ZhifangWang
Esri Regular Contributor

Hi @EdKnowles ,

Editing nested repeat (repeat in a repeat) is currently not available in the Survey123 web app. If this is important to your workflow, please feel free to add your use case or business justification to ENH-000134198 via Esri Support Service to help us prioritize the development work. Thanks.

ChrisJRoss13
Occasional Contributor

Is there a way to create a Survey123 report through Dashboards that would allow a user to generate a report from the selected record or Survey that was already submitted? 

abureaux
MVP Frequent Contributor

@ChrisJRoss13 

  • Native Built-in: Esri is apparently developing a widget for EB that will do this nativity. I didn't see an ETA though.
  • Custom Built-in: In EB, you can add the "survey" widget and use either the main survey or a custom survey built on that Feature Layer. I choose to create s second survey built on the main Feature Layer since all I needed was an email field. Then, create a report automation (e.g., in Power Automate) that triggers when that survey is submitted. Essentially, it's on-demand report generation within an EB map.
  • 3rd Party Software: VertiGIS (WAB only at this time, but should be EB soon)
  • API: There is actually a way to call on the API and generate a report in EB, but I haven't tried it. Since Esri is developing a native method, this may or may not be worth the time investment.
Blihack
New Contributor

Hi @ZhifangWang,

 

I see that the note at the bottom of the blog related to editing/viewing nested repeats is now crossed out, are there any updates regarding implementation?


Thanks

ZhifangWang
Esri Regular Contributor

Hi @Blihack ,

The Survey123 web app can now edit or view a submitted record with repeat.

However, for nested repeats, the edit and view modes still do not work. If this affects your workflow, please feel free to add your cases to ENH-000134198 via Esri Support Service.

ademshark
Occasional Contributor

Excellent article! Thank you.

Is it possible to circumvent the Dashboard setup and just supply the survey form to users in order to edit existing features? Possibly by a query of the specific GUID once a record ID or some other unique record info is supplied to the form?

ZhifangWang
Esri Regular Contributor

@ademshark ,

You can use the Survey123 web app to edit a record as long as knowing the global ID, by using the URL like https://survey123.arcgis.com/share/1cb28b212b5542acbbdbaa35feba0765?mode=edit&globalId=<globalId>.
Here is more information about directly editing in the Survey123 web app: Survey123 Tricks of the Trade: Editing records in a web form.

 

MatthewSmart86
Occasional Explorer

Hi, thanks for the post! I get the attached error when I click on a record in the list, any ideas?Survey123-in-dashboard.PNG