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

52503
78
04-27-2020 04:18 PM
IsmaelChivite
Esri Notable Contributor
22 78 52.5K

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.

78 Comments
GaryBowles1
Frequent Contributor

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

GaryBowles1
Frequent Contributor

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

Thanks,

--gary

GaryBowles1
Frequent Contributor

And my dashboard looks like this:

IsmaelChivite
Esri Notable 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!

KrisIrwin
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

IsmaelChivite
Esri Notable 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.

DerekLaw
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,

KrisIrwin
New Contributor

OK, Thank you for the fast reply.

FranciscoAndrade1
Regular 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.

IsmaelChivite
Esri Notable 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.

KrisIrwin
New Contributor

Ismael,

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

IsmaelChivite
Esri Notable 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

AprilChipman1
Emerging Contributor

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?

AprilChipman
Frequent Contributor

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?

IsmaelChivite
Esri Notable 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.

IsmaelChivite
Esri Notable 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.

JoshuaBlack
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

BritaVespere
Occasional Contributor

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. 

Shwu-jingJeng
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?  

JoshHabel
Frequent 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

ChrisRoberts2
Frequent Contributor

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?

ChrisRoberts2
Frequent Contributor

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?

EstellaSmith
Occasional Contributor

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.
Amanda__Huber
MVP 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!

by Anonymous User
Not applicable

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?

by Anonymous User
Not applicable

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.

Li_Mia
by
Occasional Explorer

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.

CarolMcClellan
Occasional Contributor

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.

ChrisRoberts2
Frequent Contributor

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

Hussam_AlJabri
Frequent 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,  

ChrisRoberts2
Frequent Contributor

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

GlenGardner1
Regular Contributor

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.

erica_poisson
Frequent Contributor

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 

DerekPhyn
Frequent 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

by Anonymous User
Not applicable

@IsmaelChivite, my question is the same as the one above from @DerekPhyn . This is the last piece of the puzzle I need to get my customer up and running. Everything seems to work as it is supposed to except for the continual loop that the survey is caught in. I open my dashboard, the survey opens (data less), in the embedded content window, and then it disappears and calls for a reload. It is caught in this vicious loop that never ends. I too am in 10.7.1 on and enterprise portal. Unfortunately, I can not include a screen shot due to my agencies portal. What could possibly be causing this loop and is there any way to stop it? Thanks.

CristianGraf
Emerging Contributor

@IsmaelChivite , @ZacharySutherby , I got the same problem as descrive in this old post:

https://community.esri.com/t5/arcgis-survey123-questions/assistance-resolving-error/td-p/851272

I got the same massage when trying to save an edition of the form on Dashboard.

Survey contains errors: 1. Press here to navigate to each error.

I have tried the form on the Phone ans Web App, nothing wrong. I have no repeats or any complex survey. 

On the Console, there's any error on Network activities...

Console.jpg

 

Any help or idea in this issue?

RonaldVanderpool
Frequent Contributor

Greetings!

Having an issue with the final connection between the existing survey data and the form. Everything was built based on the wonderful guidance above.

Specifics are the form is based on an existing feature service built in Survey123 Connect. Everything works up to the point except when a list item is selected it only flashes the embedded form but fails to populate the fields from the existing list item.

I have two pulldata calculations that are designed (and work) to auto-populate the x,y fields in the feature layer based upon the location from the selected point in the form map.

Tried the same design in Operation Dashboards and Dashboards Beta.

Any ideas?

KimberlyMcCallum
Regular Contributor

This functionality is fantastic and I have been using this adapted to Experience Builder with the Embed widget as mentioned above. Be warned however, that calculations will not work in the web app with surveys in edit mode. I have been through a round with Esri support on this and have logged it as BUG-000137725 but who knows when it will get addressed. Right now this editing QA/QC workflow is not fully functional with calculations not working properly!  

by Anonymous User
Not applicable

Hi, 

I am looking for a set up where a reviewer see an existing non-editable layer of data that was collected with field maps and uses a Survey123 form to Pass or Fail these points. I can get the Pass/Fail survey to work and the list but i can't get it to relate to the existing layer. How do I accomplist this? Should I preload the Survey with the globalid of the existing points? 

RonaldVanderpool
Frequent Contributor

Hey Stefani,

I cannot offer much for advise. If you do not receive any offers for assistance in a few days, I would recommend calling Esri Support.

I find and receive a great deal of support from the GeoNet but sometimes it is just crickets.

Good luck and be sure to post any resolutions here so we all can benefit!!

RonaldVanderpool
Frequent Contributor

Thanks for the heads up Kimberly!

Weird about the edit mode. Does not seem to me it should make a difference but obviously from your struggles, it does.

I will double check and see if this is causing my issue.

 

by Anonymous User
Not applicable

Hi All, 

I actually found a way to do what i wanted! I added few reviewer fields to the hosted featuer layer i wanted to review and then created a survey based off of that feature service with Survey123 Connect. I made all the field data collection fields read only before i published and only left the reviewer fields open for editing so when i embed the Survey all of the field data collection fields are there for reference and the last two reviewer fields are open for the reviewer to sign off on the data. 

 

Thanks all and great comments!

CPoynter
Frequent Contributor

Hi @IsmaelChivite,

Great posting.

I have a scenario where I have a survey which creates a point location with barcodes used to make unique location IDs. A second survey creates a dataset using the barcodes to provide a relationship for repeat site sampling. Is is possible to embed two surveys into a dashboard to correct/edit data in both datasets and possibly remove/delete initial 'training' samples. 'Training' day points and records have been mixed with actual project data.

Regards,

Craig

 

 

PaulSweeney3
Frequent Contributor

Hi All 

For all users of this workflow you should look into using Data Expressions to combine multiple features into one feature set and include a separate field called "form ID"(include the item ID of the survey in the value ) into your dictionary to be added to the feature set. This way you can link the formID field into your embedded content url  which allows you to use multiple forms in the same dashboard. See sample below. Its a very useful tool for us. 

 

var combinedDict = {
fields: [
{ name: "CreatedDate", type: "esriFieldTypeDate"},
{ name: "FORMID", type: "esriFieldTypeString" },
{ name: "globalid", type: "esriFieldTypeString" },
{ name: "Parentglobalid", type: "esriFieldTypeString" },
{ name: "Review_Status", type: "esriFieldTypeString" },
{ name: "Review_Comments", type: "esriFieldTypeString" }
],
geometryType: "",
features: [],
};

var i = 0;
for (var m in Feature) {
var start = ToLocal(Date(1970, 0, 01, 0, 0, 0, 0))
var dtMDN = DateDiff(m.CreationDate, start, 'milliseconds')
combinedDict.features[i] = {
attributes: {
Del_Area: "MDN",
CreatedDate: dtMDN,
Crew: m.Crew_DD,
FORMID: "Insert form ID here for each layer",
globalid: m.globalid,
Parentglobalid: m.parentglobalid
},
};
i++;
}

 

MikeOnzay
Frequent Contributor

@KimberlyMcCallumI found that my automatic date calculation was not working with my web survey in a dashboard. It worked fine in the field app. In the survey, I would  see a "recalculate" button and it populated the question box but it would submit the value. 

My work around was to create a calculate question as a null field (bind:type: datetime) with the calculation and then pass that value into a hidden field (bind:esri:fieldtype: esriFieldTypeDate). Upon submittal, the value appears in the feature layer.

workaround.JPG

AshleyHayes2
Regular Contributor

I was able to embed my Survey123 into a dashboard and make it editable, etc.  My only issue is that the html formatting that I used for label backgrounds colors in my Survey123 form is not working (it shows the html as text in my label).  It works perfectly when viewed via Survey123, but it does not work when viewed as embedded content in a dashboard.  Is that what you would expect or is there something I am potentially missing?  Thanks.

KellyArmstrong
Frequent Contributor

I have 15 different forms, one for each feature class.  How would I implement this if I click in the list for one feature class...how would I relate it to its form, versus clicking in the list that is related to another feature class and bringing up its form?

GaryBowles1
Frequent Contributor

Ismael,

I have a survey embedded in a dashboard for data review and editing. One of the fields in the survey does not display in the dashboard, it is blank. If i look at the field in edit or view mode in the inbox of the Inbox of the field app, the data displays.

The field is a text field with the following inputMask >AAA in the body::esri:inputMask column. It is not within a group or a repeat.

I have an integer field with input Mask 99999 that displays fine in the dashboard.

Ideas?

thanks,

--gary

LinzMess
Occasional Contributor

@IsmaelChivite 

I am interested in embedding a survey into a dashboard which would allow users to follow-up on issues raised during a survey in the field. Specifically, I have a survey where an inspector conducts a safety survey in a room. In that room, there may be many 'findings' documented (within a repeat). I would like to then embedded a survey that writes to the same feature layer into a dashboard where follow-up from the field finding can be documented (what was done, when, by who, image of correction attached). The issue I am running into is that the findings are within a repeat and thus a related table. I only want the follow-up to be possible within the dashboard, not the field survey. I also want to be able to show at a glance how many findings need resolution, etc.

ShaddaiSpencer
New Explorer

Hello, 

I have tried this and I made sure these surveys were share and published but I am getting the checking feature service and it is not publishing. It is just stuck there. This is what it is giving me on the review form. I did use the right url I believe from the original submission survey so this is just my survey for marking these as complete or in progress. Do I need to not have spaces in the form id or is this a different issue? 

ShaddaiSpencer_0-1665760284751.png