Retrieve Forms (v2)
This tutorial demonstrates how to retrieve a project’s Forms using the v2 API endpoint, which provides enhanced response data including native form values and layout information.
Before You Begin
- Register an app
- Acquire a 3-legged OAuth token with the
data:readscope. - Verify that you have access to the relevant ACC project.
Step 1: Find the Form Template IDs
Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) to retrieve the project’s Form Templates, by calling GET form-templates.
Request
Response
The response payload includes the Form Template IDs (data.id).
Step 2: Retrieve Forms Using the v2 API Endpoint
Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) and template ID (2f634a22-779d-4930-9f08-8391a41fea05) from previous step to retrieve the project’s Forms, by calling GET v2 forms.
The v2 endpoint provides enhanced capabilities including:
- Native form values in the response (
nativeForm.tabularValuesandnativeForm.customValues) - Layout information (
nativeForm.layoutInfo) - Additional filtering and sorting options
- Optional inclusion of extra data via the
includeparameter
Request
Response
The response payload includes:
-
Form IDs (
data.id) -
Native form structure (
data.nativeForm) with:- Layout information (
layoutInfo) - Tabular values (
tabularValues) - data from tables like work log, materials, equipment, and custom tables - Custom values (
customValues) - data from regular form fields
- Layout information (
-
Form metadata (status, dates, assignees, etc.)
Understanding the Response Structure
The v2 API response includes the nativeForm object which contains:
Layout Information
The layoutInfo object provides details about the form’s template structure, including whether section assignees are enabled.
Tabular Values
The tabularValues array contains rows from all tables in the form:
-
Built-in tables:
worklogEntries,materialsEntries,equipmentEntries- includes full column details -
Custom tables: Identified by their UUID schema identifier - to get detailed column values for custom tables, use the GET table values endpoint
-
Each row includes:
id: Unique identifier for the rowschema: Table identifier (built-in alias or UUID for custom tables)columns: Array of column values with their types (textVal, numberVal, timespanVal, etc.) - available for built-in tablesrank: Sort orderdeleted: Whether the row is marked as deleted
Custom Values
The customValues array contains values from regular form fields (non-tabular):
fieldId: Unique identifier for the fieldvalueName: Type of value (textVal, numberVal, toggleVal, choiceVal, dateVal, svgVal, arrayVal)- The actual value in the corresponding field (e.g.,
textVal,numberVal) notes: Optional notes for the field
Step 3 (Optional): Filter Forms by Location
You can filter forms by location using the locationIds query parameter. Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) and location IDs to call the v2 GET forms endpoint.
Request
Response
The response will include only forms associated with the specified locations. The structure is the same as shown in Step 2.
Additional Query Parameters
The v2 API supports additional query parameters for filtering and sorting:
statuses: Filter by form status (draft, inReview, submitted, archived)formDateMin/formDateMax: Filter by form date rangeupdatedAfter/updatedBefore: Filter by update timestampsort: Sort results (e.g.,updatedAt desc,formNum asc)search: Search for forms containing specific textincludeSubLocations: Include forms from sub-locationsinclude: Include additional data (nativeValues, tableMetadata, layoutInformation, sublocations, inactiveFormTemplates)
Step 4 (Optional): Retrieve Custom Table Values
For custom tables, you need to use the GET table values endpoint to retrieve detailed column data. Use the form ID from Step 2 and the table’s field ID (UID).
To find the table field ID, you can:
- Call GET layouts/:layoutId to get the layout structure
- Call GET sections/:sectionId to get the table’s UID from the section items
For this example, assume you have a custom table with field ID d4b7df4c-24e8-583h-76g6-89f96e94i285.
Request
Response
The response includes:
- Row metadata:
id,schema(UUID for custom tables),rank,deleted - Column details: Each column includes
formValueId,columnId,columnName, and the value field (textVal,dateVal, etc.) - Pagination: Use
offsetandlimitto page through large tables
Congratulations! You have retrieved Forms using the v2 API with enhanced response data including native form values and layout information, and learned how to retrieve detailed custom table values.
Imported from the Autodesk Platform Services documentation: https://aps.autodesk.com/en/docs/acc/v1/tutorials/forms/retrieve-forms-v2.