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

9390
34
04-27-2020 04:18 PM
Esri Frequent Contributor
11 34 9,390

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.
  • 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.

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!

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.

34 Comments
Occasional Contributor III

Ismael,

Does this work for surveys that are in Enterprise and published with Connect?

What would the URL be that I would enter in the embedded content?

Thanks,

--gary

Occasional Contributor III

When I try to save the survey in collaborate on the survey123 website i get the following error:

Thanks,

--gary

Occasional Contributor III

And my dashboard looks like this:

Esri Frequent Contributor

Hi Gary, since you are using ArcGIS Enterprise, the parameters in the URL should look like this: &mode=edit&globalId= This is because your survey URL already has the ? sign to pass the portalUrl parameter. I made a slight modification in the blog post to be more specific about this. Thanks!

New Contributor

Ismael,

This worked great. Do you know if there is a way to view pictures in a dashboard that were created in a Survey123 repeat and are linked in a related table?

Thanks, Kris

Esri Frequent Contributor

Hi Kris Irwin‌ I am not quite sure if it is possible to show images in a dashboard from a related standalone table. Looping Derek Law‌ in case he can provide some guidance.

Esri Esteemed Contributor

Hi Kris,

> Do you know if there is a way to view pictures in a dashboard that were created in a Survey123 repeat and are linked in a related table?

Images within a repeat in a survey, do not appear in a pop-up in dashboards; this is a known limitation in ArcGIS Dashboards. Sorry. Please submit an enhancement request on the ArcGIS Ideas for ArcGIS Dashboards.

 

Hope this helps,

New Contributor

OK, Thank you for the fast reply.

Occasional Contributor

Do web hooks get triggered using the web version of Survey123?

We are using Operations Dashboard as in the example mentioned in the post. We are allowing user to edit the data in Survey123 form. Once the data was edited and submitted, the web hook was not trigger. 

I then went to the survey123 app and did an edit and submitted my edit and webhook got triggered. 

I am not sure if I am doing something wrong.

Esri Frequent Contributor

Hi Francisco Andrade‌   Both apps will trigger your scenario when data is added and/or updated. Just make sure both events are checked when you create your webhook.

New Contributor

Ismael,

How did you get this default view to display when a list item is not selected?

Esri Frequent Contributor

Kris Irwin‌  That is the 'Thank You' screen, which you can configure from survey123.arcgis.com

  • Log in to survey123.arcgis.com
  • Open the design view of your survey and use the survey settings dialog to change your Thank You screen.
  • Note that configuration of the Thank You screen in Survey123 designer is supported on both Survey123 designer AND Connect surveys.

Survey123 ThankYou screen

New Contributor II

I created a dashboard following these instructions last week, and I'm pretty sure I got it to work (using objectid rather than globalid), but today it's not working at all. I was on Survey123 Connect v3.7, but upgraded to 3.9 today to see if the new version would help get this process working. No luck.    I'm on Enterprise/Portal 10.6.1

I can see the globalid field in the list of fields on the REST service, but I don't see that option in any of the dashboard widget field choice lists.

Any ideas on how to get the globalID choice working?

Occasional Contributor III

I'm trying to embed a survey with a pulldata calculation - when a name is selected, it automatically fills in the email address from a file - but the embedded survey is giving a "FormLogicError: Could not evaluate: instance ..."

Does the pulldata function not work when embedding surveys in Ops Dashboard?

Esri Frequent Contributor

April Chipman‌  As you may know we are dropping support for using objectIds in our next update (July 2020). If ArcGIS dashboard is not showing the globalid field in the field choice list, then it will be best to figure out why. I suggest you ask this question in the ArcGIS Dashboards‌ group. I wonder if this could have something to do with the version of enterprise? Not sure.

Esri Frequent Contributor

Hi April Chipman‌  There should be no difference between a survey running standalone versus running embedded. Can you share the XLSForm? If so, someone in Geonet may be able to pinpoint why pulldata is not running in the web browser app.

New Contributor

Ismael Chivite‌ Aloha - We originally create a feature layer (published to AGOL) to enter data.  From that feature layer we created survey123 (published to AGOL) using the feature service selector.  We created the survey to enter data, good to go.  Then we Saved As and created the update survey (published to AGOL), good to go.  All Sharing was enabled to the same groups.  I created a dashboard and when embeded - the following error is displayed.  

"Editing is not possible because the globalid parameter was not provided" - I double checked the feature layer in AGOL and ensure the visibility is allowed.  I notice the other surveys we created from scratch and not adapted from a published feature layer work, just this one?   Any guidance?

Mahalo,


Josh

New Contributor II

I would argue that it is possible to chose the related table from the feature service for the Details element (not the layer containing all other survey attributes) and it will return my attached images also by filtering those by the unique feature selected on the map or in the list. 

I did add a hidden field that calculates the date from the survey response input in the related table so that I can also filter both (attributes from layer and table) by time. 

However, I am interested - is it possible to view the survey without the editing option on? As the survey does not contain a geopoint question and the map view in the survey Data section for sharing is confusing to some when browsing the answers. 

Esri Regular Contributor

Hi Joshua,

I followed the similar scenario you described here using 3.9 Connect but was unable to reproduce the issue. Could you contact Tech Support and provide them a reproduce case so that they can troubleshoot this further?  

Occasional Contributor

Hi,

I discovered what the issue was. I had some pull data formulas that were looking for CVS files that were missing. I removed the formulas as they were not necessary and it works now.

Josh

Sent from my Verizon, Samsung Galaxy smartphone

Occasional Contributor II

Hi Ismael

This Blog is fantastic. I have the same question as Kris,  I have done what you suggested regarding the thank you screen, however on initial load the form is still populated by the first entry in the list.  The "thank you" screen doesnt appear until the an edit has been submitted.  Is there a way of have the screen as per your example appear on initial load?

Occasional Contributor II

Hi,

Is it possible to use this method to create a new survey in an embedded element.  That is, use a link in a pop up (like you would for Explorer) so instead of opening up the web form in a new window it uses the embedded form?

New Contributor II

Ismael Chivite‌ Do you know when it will be possible to edit repeats in the web app so it will work in the Dashboard?  I get an error message as you mention in your blog.  I would really like to utilize the Dashboard feature to make edits to my data. Thanks.  

Error: Initializing form...

  • Currently, nested repeats are not supported in the web app. Submitting records to this survey may lead to unexpected results and possible missing data.
Regular Contributor

Chris Roberts‌, 

There's actually a new widget in ArcGIS ArcGIS Experience Builder‌ that does just that. 

You are able to embed a survey into the Experience (without having to open a new tab). You can also connect it to other widgets (like maps) to pass information to the survey (like url parameters) using the widget's configuration tools.

Hope this helps/ answers your question!

Occasional Contributor

Ismael,

I've created a survey, web map, and subsequent dashboard to follow these steps. My survey has a few cached responses that are intended to add to the end users ease of use. When I am selecting the entry in my list the last cached information is all that is displaying and nothing for any of the other non-cached or default responses. Any idea what could be causing this to not update the form as expected?

Occasional Contributor

Trying a few different things here to try to get this to work. I turned off the draft mode option and deselected all the cached and/or default answers.

My editing pane for the dashboard looks like this:

With the embedded survey element having the following URL: https://survey123.arcgis.com/share/2d58ea...

And the actions for my list element set to filter the embedded content

However, it is not pulling the information into the survey element and when I do enter information in it is creating a new record rather than updating the existing.

Any thoughts or advice would be greatly appreciated.

by
New Contributor

Hi Ismael, I would like to do the same thing for my dashboard as Chris described above. Right now, when I open the dashboard, it automatically opens the survey in editing mode for the first record on the list. I would like to configure it to ask the user to select an individual record on the list before it populates the survey in the embed content. Is this possible?

Thank you.

New Contributor II

Did you get an answer to this question re: how to default to the thank you screen? I am attempting to do the same thing, but my form also defaults to first feature. This has already resulted in survey entry errors due to people skipping the select step and populating the form as soon as they see it.

Occasional Contributor II

Hi Carol

No not as yet.  I have ended up putting in a rich text element with some text to remind people to select the appropriate record.  Not a perfect solution...but its something

Occasional Contributor

Hi Ismael Chivite‌, Thanks for the great effort you paid in this post.

I'm wondering if we can have one survey to be filled by multiple users and each group of users will have a group of question so then we can leverage survey123 in our workflow.

regards,  

Occasional Contributor II

With some users they can't see the embedded webform in Chrome, it just comes up with saying the Form does not exist ... error.  However they can see the form outside of an embedded content, and, if they use Edge they can see the embedded form.  It just seems to be something with Chrome.  Also its not universal, some users have no issues at all.

There is another forum Post about this, but the workaround didnt work for us, and it appears that the solution doesnt work for them either now.

https://community.esri.com/message/947781-re-embedded-survey123-web-form-works-for-some-but-not-othe...

We are using Enterprise 10.7.1

Just wondering if anyone else has seen this and if so have found a solution?

Cheers

New Contributor III

I too would like this to be able to work with surveys with repeats in them. That or is there a way for something similar to this that would work with a parent asset and child inspection type workflow.

Occasional Contributor III

Hi Ismael Chivite‌,

I was curious if there were plans to allow surveys with nested repeats to be embedded in Dashboards w/ mode=view

I have a survey w/ nested repeats that some managers want to be able to review for accountability purposes. I was hoping I'd be able to use a Dashboard to do this, so they could select a record and view the full contents of the survey in one easy-to-read window. When I attempt it, I get the message "This survey contains one or more nested repeats, which are not supported in the view or edit mode of the Survey123 web app.

The thought here is, managers can review submissions without having to export surveys to the custom report template. 

The only other methods I've found for doing this involves a "List" and multiple "Details" elements in a Dashboard, which is not very user friendly or streamlined. I've run into similar issues with Experience Builder. 

Thank you,

Erica 

Occasional Contributor

@IsmaelChivite This looks just like the tool I need but when following your methods using Enterprise Portal 10.7.1 the form interface in the dashboard just keeps constantly refreshing without any values showing despite having the refresh interval for the layer set to 5 minutes in the webmap. Any ideas what could be going wrong? The survey and feature layer is not public and I wonder if this a prerequisite for embedded content given this hint in the survey's collaborate page on https://survey123.arcgis.com/

DerekPhyn_0-1606361430016.png