Embed a survey using an iframe

You can embed a survey in your custom web app using an inline frame (iframe).

Embed a survey in ArcGIS Dashboards

ArcGIS Dashboards allows you to convey information by presenting location-based analytics using intuitive and interactive data visualizations on a single screen.

You can embed a survey in a dashboard using the embedded content element. When using this element, you must choose the feature layer to target, add the URL to your survey, and set the maximum number of features to display. Optionally, you can add parameters to load an existing survey record.

An example of embedding a survey in ArcGIS Dashboards is described in the Mosquito Spray Exclusion blog post.

Embed a survey in a custom web app

To embed a survey directly in your custom web app, create an iframe element and add HTML that represents the survey.

On the Collaborate tab of the Survey123 website, click the Embed in website link under the Share this survey section to open a tab that provides HTML to embed your survey in a web page.

In the Embed options section, you can hide cosmetic survey elements when embedded. Elements that can be hidden include the options at the top of the survey, the header, the survey description, and the footer, as well as the option to ignore the survey's theme.

The National Willow Tit Survey is an example of embedding a survey in a web app.

Parameters

When you embed a survey in either ArcGIS Dashboards or your custom web app, you can add parameters to control the way survey is displayed.

The following ArcGIS Dashboards example displays the form for a selected record in edit mode:

 
1
https://survey123.arcgis.com/share/acb28b212b5542acbbdbaa35feba0765?mode=edit&globalId={globalid}

Available parameters are listed in the following table:

Parameter

Description

Example

Type

center

Centers the map to known latitude, longitude, and optional altitude.

center=37.8199,-122.4783,20

String

field:fieldname

Populates survey questions with field values.

field:surname=Klauser

String

portalUrl

Specifies the URL to the portal where the survey item is hosted.

portalUrl=https://myorg.arcgis.com

String

open

Specifies the app used to open the survey. Valid values are web , which opens the survey in the web app (the default), native , which opens the survey in the field app if the field app is installed, and menu , which opens a web page to determine the app that will open the survey.

open=web

String

hide

Hides elements of the survey in the web app. It can accept multiple values separated by a comma. Valid values are navbar (the bar at the top of the survey, including options to log in, log out, and change language), header , description , footer , and theme . You can also use the field:fieldName parameter to hide a specific question, group, page, or repeat, by providing the name in place of fieldName .

hide=header,description,footer,theme

String

locale

Switches the language of the survey. It only works if the survey includes multiple languages.

locale=zh-cn

String

mode

Sets the mode of the web form. Valid values are edit , which sets the survey to edit an existing entry rather than create one; view , which opens an existing entry in read-only mode; and copy , which creates a survey that is populated with the contents of the specified entry. When using this parameter, the globalId parameter must also be provided.

mode=edit&globalid=42db492cb06111ea...

String

globalId

Specifies the survey record that's loaded into the form. Valid values are the global IDs for existing survey records. The name of this parameter is case sensitive.

globalId=42db492cb06111ea...

String

version

Sets the version of the web app that will be used. The only valid value is latest , which uses the latest version of the web app, even if the survey is version locked.

version=latest

String

token

Passes a valid token for a survey. It can be used to allow respondents to respond to a survey that requires an ArcGIS account to access without signing in.

token= E60M4Gsc-h4Q8plqQ...

String

autoRefresh

Refreshes the survey after submission. Specify the delay (in seconds) before the survey is refreshed.

autoRefresh=3

Integer

encodeUrlParams

Obscures URL parameters. The resulting URL will instead include a code parameter representing all encoded parameters; parameters included outside of this code parameter will be ignored.

encodeUrlParams=true

Boolean

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.