ArcGIS Survey123
ArcGIS Survey123 is Esri's form-centric field data collection app. Protocol Launcher allows you to generate ArcGIS Survey123 URL scheme links.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
URL Scheme
Esri documents four Survey123 launch patterns: the web app share URL https://survey123.arcgis.com/share/ID, the field app app link https://survey123.arcgis.app, the field app custom scheme arcgis-survey123://, and the Survey123 Connect scheme arcgis-survey123connect://.
The field app accepts the documented URL parameters center, field:<question name>, portalUrl, itemID, download, action, folder, callback, callback:<status>, filter, update, and q:<query parameter>. The web app uses the survey item ID as the path segment and accepts the documented web app parameters signIn, isOrgSignIn, center, field:<question name>, portalUrl, open, hide, locale, mode, globalId, recalculate, version, token, autoReload, autoRefresh, encodeUrlParams, and width. Survey123 Connect accepts only portalUrl and itemID.
Launch Field App
Launch the Survey123 field app with the custom URL scheme.
import { launchFieldApp } from 'protocol-launcher/arcgis-survey123'
const url = launchFieldApp({
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
fields: { surname: 'Klauser' },
center: '37.8199,-122.4783,20',
})Launch Field App Link
Launch the Survey123 field app with the app link recommended for iOS and Android app-to-app links.
import { launchFieldAppLink } from 'protocol-launcher/arcgis-survey123'
const url = launchFieldAppLink({
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
fields: { surname: 'Klauser' },
})Launch Web App
Open a survey in the Survey123 web app.
import { launchWebApp } from 'protocol-launcher/arcgis-survey123'
const url = launchWebApp({
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
fields: { surname: 'Klauser' },
center: '37.8199,-122.4783',
})Launch Connect
Open a survey in Survey123 Connect. Esri documents that both portalUrl and itemID are required.
import { launchConnect } from 'protocol-launcher/arcgis-survey123'
const url = launchConnect({
portalUrl: 'https://www.arcgis.com',
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
})Generated URLs
launchFieldApp({
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
fields: { surname: 'Klauser' },
center: '37.8199,-122.4783,20',
})
// => 'arcgis-survey123://?itemID=36ff9e8c13e042a58cfce4ad87f55d19&field:surname=Klauser¢er=37.8199%2C-122.4783%2C20'
launchFieldAppLink({
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
fields: { surname: 'Klauser' },
})
// => 'https://survey123.arcgis.app?itemID=36ff9e8c13e042a58cfce4ad87f55d19&field:surname=Klauser'
launchWebApp({
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
fields: { surname: 'Klauser' },
center: '37.8199,-122.4783',
})
// => 'https://survey123.arcgis.com/share/36ff9e8c13e042a58cfce4ad87f55d19?field:surname=Klauser¢er=37.8199%2C-122.4783'
launchConnect({
portalUrl: 'https://www.arcgis.com',
itemID: '36ff9e8c13e042a58cfce4ad87f55d19',
})
// => 'arcgis-survey123connect://?portalUrl=https%3A%2F%2Fwww.arcgis.com&itemID=36ff9e8c13e042a58cfce4ad87f55d19'