Use an inline frame (iframe) to embed a page from which a report can be generated, in your custom web app. To configure the required URL parameters for the report page, start with the URL https://survey123.arcgis.com/featureReport, then add the following required parameters:
- surveyItemId - The survey item ID for which you are generating a report. This provides the context for the survey questions in the report.
- featureLayerUrl - The source feature layer or the result feature layer view of the survey. This is where the data to populate the report comes from. The value should look like https://services1.arcgis.com/oC086ufSSQ6Avnw2/arcgis/rest/services/serviceName/FeatureServer/0.
- queryParameters - A JSON string whose value will be passed to the query operation to filter data as input features for the report.
To put these together, your report page URL should look similar to this:
https://survey123.arcgis.com/featureReport?surveyItemId=<surveyId>&featureLayerUrl=<feature layer URL>&queryParameters={"where": "STATUS = 'broken'","orderByFields":"inspectionDate DESC","resultRecordCount":10}
Embed a report page 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 report page in a dashboard using the embedded content element. Optionally, you can add parameters to preset the print settings.
Embed a report page in a custom web app
To embed a report page directly in your custom web app, create an iframe element and add HTML that represents the report page.
On the Data tab of the Survey123 website, click the Report link button under the Report panel to open a dialog that provides the URL to embed your current report settings in a web page.
Parameters
When you embed a report page in either ArcGIS Dashborads or your custom web app, you can add parameters to control the way the report page is displayed.
The following example displays the report page in the embed element in ArcGIS Dashboards, which allows you to generate a report for the selected features:
https://survey123.arcgis.com/featureReport?featureLayerUrl=https://services1.arcgis.com/oC086ufSSQ6Avn00/arcgis/rest/services/<service name>/FeatureServer/0&queryParameters=%7B%22objectIds%22%3A%22{field/objectid}%22%7D&inputFeatureTemplate=Feature%20%7Bobjectid%7D%3A%20%7Buntitled_question_1%7D&surveyItemId=<surveyId>
Available parameters are listed in the following table:
Parameter | Required | Description | Example |
---|---|---|---|
survey | Yes | The survey item ID you generate a report for. This provides the report context of survey questions. | survey |
feature | Yes | The source feature layer or the result feature layer view of the survey. This is where the data comes from to populate the report. | feature . |
query | Yes | This is the same parameter used in the report REST API, a JSON string whose value will be passed to the query operation to filter data as input features for the report. where , object , order , and result are supported. | For example, in a hydrant inspection layer, {"where": "STATUS = 'broken'","order will send the latest 10 hydrant features in broken status to the report. |
portal | No | Specifies the URL to the portal where the survey and feature layer item is hosted. For instance, when connecting to your ArcGIS Enterprise. | portal |
client | No | The Client ID when registering the app (parent page) in ArcGIS Online. Ignore this parameter if you are embedding the page into ArcGIS apps (e.g., ArcGIS Dashboards). | client |
show | No | Comma-separated array. Only the elements specified in this list will be shown. Supported elements: input , select , file , report , save , output , show , recent , navbar . The "Output settings" section title shows up when any of the following shows: file , report , save , output . | show=navbar,input |
hide | No | Comma-separated array. All elements except those specified in this list will be shown. Supported elements are the same as with the show parameter. | hide=navbar,input |
input | No | Defines how a feature displays in the “Input features” section. Use {<field to refer to an attribute value. | For example, input -> Hydrant 1245, Status: |
report | No | A comma-separated string for report template item IDs. If present, the report template dropdown list only shows templates specified in this list. Otherwise, the dropdown list shows all templates related to the survey. | report |
label | No | A JSON string to overwrite text labels for each element. | label={"input |
page | No | Specifies the title of this page. | page |