You can programmatically create reports from your ArcGIS Survey123 survey data using the feature REST operation. Use Microsoft Word templates to create custom reports with maps, images, and formatted data. The API supports template creation, validation, report generation, and file downloads.
The feature operation provides these core operations:
| Operation | Endpoint | Purpose |
|---|---|---|
| Create Template | /create | Generate Word template with survey field placeholders |
| Validate Template | /check | Check template syntax for errors |
| Generate Report | /create | Submit report generation job |
| Check Status | /jobs/{job | Monitor job progress |
| Download Files | Job response URLs | Retrieve completed reports |
Prerequisites
Before using the feature API, you need:
- ArcGIS Account with Publisher or Administrator role
- Survey123 feature layer with survey data
- Access token for authentication
- Word template (.docx) with survey data placeholders (optional)
- Network access to Survey123 API endpoints
- Understanding of REST API concepts and authentication
How to create custom reports with Feature Report API
To create custom reports with the Feature Report API, you use the REST API endpoints to generate Word or PDF reports from your Survey123 survey data. The API provides template creation, validation, report generation, and file download capabilities for creating professional reports with maps, images, and formatted data.
The general steps are:
- Create or upload template: Generate a sample template or upload your Word template with survey data placeholders
- Validate template: Check template syntax to catch errors before report generation
- Submit report job: Send report generation request with feature layer, template, and query parameters
- Monitor and download: Check job status and download completed reports
Feature Report API interface
The Feature Report API provides REST endpoints for creating custom reports from Survey123 data. You work with Word templates containing placeholders for survey fields and use the API to generate reports in Word or PDF format.
Key API components:
- Template management: Create sample templates and validate custom templates
- Report generation: Submit jobs to generate reports from survey data
- Job monitoring: Track report generation progress and handle completion
- File downloads: Retrieve completed reports in various formats
API endpoints and operations
The Feature Report API provides these core operations:
https://survey123.arcgis.com/api/featureReport/Available operations:
/create- Generate Word template with survey field placeholdersSample Template /check- Validate template syntax for errorsTemplate Syntax /create- Submit report generation jobReport /jobs/{job- Monitor job progress and statusId} - Job response URLs - Download completed reports
Template configuration options
When creating custom reports with the Feature Report API, you can configure various options:
Template settings:
- Word document format (.docx) with survey field placeholders
- Custom branding and organization styling
- Conditional visibility for report sections
- Image and map integration with size controls
Report parameters:
- Output format (Word .docx or PDF)
- Query parameters to select specific records
- Batch processing for multiple reports
- File packaging and naming options
Advanced features:
- Related records (repeats) inclusion
- Date and time formatting
- Image size and quality controls
- Map insertion with specific settings
Best practices
Follow these essential best practices for using the feature operation:
- Validate templates before generating reports to catch syntax errors
- Test with sample data before processing production surveys
- Use batch processing for large datasets (max 1,000 records per job)
- Monitor job status to handle failures gracefully
- Optimize template size by removing unnecessary formatting and images
Code examples
Create a sample template
Generate a Word template with placeholders for all survey fields. This template serves as a starting point for customization.
// Replace with your actual values
const featureLayerUrl = "https://services.arcgis.com/your_org/arcgis/rest/services/your_survey/FeatureServer/0";
const token = "YOUR_ACCESS_TOKEN";
// Prepare the form data
const formData = new FormData();
formData.append("featureLayerUrl", featureLayerUrl);
formData.append("token", token);
formData.append("outputFormat", "docx"); // or 'pdf'
// POST request to create sample template
fetch("https://survey123.arcgis.com/api/featureReport/createSampleTemplate", {
method: "POST",
body: formData
})
.then(response => {
if (!response.ok) throw new Error("Network response was not ok");
return response.blob();
})
.then(blob => {
// Download the template file
const url = window.URL.createObjectURL(blob);
const a = document.createElement("a");
a.style.display = "none";
a.href = url;
a.download = "Survey123_Sample_Template.docx";
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
})
.catch(error => {
console.error("Error creating template:", error);
});Validate template syntax
Check your Word template for syntax errors before generating reports. This prevents job failures due to template issues.
// Replace with your actual values
const featureLayerUrl = "https://services.arcgis.com/your_org/arcgis/rest/services/your_survey/FeatureServer/0";
const token = "YOUR_ACCESS_TOKEN";
// Get template file from file input
const fileInput = document.getElementById("templateFileInput");
fileInput.addEventListener("change", function(event) {
const file = event.target.files[0];
if (!file) {
alert("Please select a template file (.docx).");
return;
}
// Prepare form data
const formData = new FormData();
formData.append("templateFile", file);
formData.append("featureLayerUrl", featureLayerUrl);
formData.append("token", token);
// POST request to validate template
fetch("https://survey123.arcgis.com/api/featureReport/checkTemplateSyntax", {
method: "POST",
body: formData
})
.then(response => response.json())
.then(result => {
if (result.error) {
console.error("Error:", result.error);
} else if (result.syntaxErrors && result.syntaxErrors.length > 0) {
console.error("Syntax errors:", result.syntaxErrors);
} else {
console.log("Template is valid");
}
})
.catch(error => {
console.error("Error checking template:", error);
});
});Generate reports
Submit a report generation job to create reports from your survey data. Monitor the job status and download completed reports.
// Replace with your actual values
const featureLayerUrl = "https://services.arcgis.com/your_org/arcgis/rest/services/your_survey/FeatureServer/0";
const templateItemId = "YOUR_TEMPLATE_ITEM_ID";
const token = "YOUR_ACCESS_TOKEN";
// Build request payload
const payload = {
featureLayerUrl,
templateItemId,
token,
queryParameters: {
objectIds: "1,2,3" // Generate reports for specific records
},
outputFormat: "pdf",
outputReportName: "My_Report",
packageFiles: true
};
// Submit report generation job
fetch("https://survey123.arcgis.com/api/featureReport/createReport", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
})
.then(response => response.json())
.then(result => {
if (result.jobId) {
console.log("Job submitted:", result.jobId);
// Poll job status (see next example)
} else if (result.error) {
console.error("Error:", result.error.message);
}
})
.catch(error => {
console.error("Error submitting job:", error);
});Monitor job status
Check the status of your report generation job and download completed reports.
// Replace with your actual token
const token = "YOUR_ACCESS_TOKEN";
// Poll job status
function checkJobStatus(jobId) {
fetch(`https://survey123.arcgis.com/api/featureReport/jobs/${jobId}?token=${token}`)
.then(response => {
if (!response.ok) throw new Error("Network response was not ok");
return response.json();
})
.then(result => {
console.log("Job status:", result.jobStatus);
if (result.jobStatus === "esriJobSucceeded") {
// Download completed reports
result.resultFiles.forEach(file => {
console.log("Download:", file.url);
// Handle file download
window.open(file.url, "_blank");
});
} else if (result.jobStatus === "esriJobFailed") {
console.error("Job failed:", result.messages);
} else if (result.jobStatus === "esriJobExecuting" || result.jobStatus === "esriJobSubmitted") {
// Job still running, poll again after 5 seconds
setTimeout(() => checkJobStatus(jobId), 5000);
}
})
.catch(error => {
console.error("Error checking job status:", error);
});
}
// Start polling with job ID from report generation
checkJobStatus("your_job_id");Tutorials

Create a simple survey
Learn how to use ArcGIS Survey123 to create a simple survey.
Low-code/no-code

Analyze survey results
Learn how to use ArcGIS Survey123 to analyze survey results.
Low-code/no-code

Create a survey and dashboard for park maintenance
Learn how to integrate ArcGIS Survey123 with ArcGIS Dashboards to create a reporting solution.
Low-code/no-code

Create a smarter, responsive survey
Learn how to create intelligent surveys with conditional logic, hidden fields, and dynamic visibility using ArcGIS Survey123 and XLSForm.
Low-code/no-code