Work with Form Layouts and Custom Tables
This tutorial demonstrates the complete workflow for working with form templates, including retrieving layout information, creating forms, and updating both regular fields and custom table values. You will learn how to work with native tables (work log, materials, equipment) as well as custom tables defined in your form templates.
For more information about Forms, see the Forms help documentation.
Before You Begin
- Register an app, and select Autodesk Construction Cloud API
- Acquire a 3-legged OAuth token with
data:readanddata:writescopes. - Find the relevant project ID, by following the Retrieve a Project ID tutorial. In this example, assume the project ID is
9ba6681e-1952-4d54-aac4-9de6d9858dd4. - Verify that you have access to the relevant ACC project.
- Verify that you were added as a contributor to the form templates in that project, see the Forms help documentation for information about creating and configuring templates.
Step 1: Get Form Template and Layout Information
First, retrieve the form templates available in your project by calling GET form-templates.
Request
Response
Note the template ID (2f634a22-779d-4930-9f08-8391a41fea05) and layout ID (7e8f9a0b-1c2d-3e4f-5a6b-7c8d9e0f1a2b).
Get Layout Structure
Now retrieve the layout structure by calling GET layouts/:layoutId. This returns the layout metadata and a list of sections. To get detailed information about fields and tables within each section, you’ll need to call GET sections (shown in the next step).
Request
Response
Understanding the Layout Response
The layout response contains basic information about the form template structure:
Layout
The layout object provides the layout UID, type, and description.
Sections
The sections array lists all sections in the form. Each section has:
uid: Section unique identifierid: Section IDlabel: Section namedescription: Section description
Note the section UIDs as you’ll need them in the next step to retrieve detailed section information including fields and tables.
Get Section Details
To get the fields and tables within a section, call GET sections/:sectionId for each section. Let’s retrieve the “Equipment Inspection” section which contains a custom table.
Request
Response
Understanding Section Details
The section details response includes:
Section Object
The section object contains basic information about the section (uid, label, description, etc.).
Section Items
The sectionItems array contains the fields and tables within the section. Items can be:
- Fields (
type: "field"): Regular form fields with avalueNameindicating the value type (textVal, numberVal, choiceVal, toggleVal, dateVal, svgVal, arrayVal) - Tables (
type: "table"): Tabular data with aschemaidentifier (UUID format)
Table Columns
The tableColumns object maps table UIDs to their column definitions. Each column has:
uid: Column identifier (use this for custom tables)columnKey: Column key namecolumnType: Data type (text_val, number_val, date_val, etc.)label: Display label
Identifying Native vs Custom Tables
- Native tables: Have schema values
worklogEntries,materialsEntries, orequipmentEntries - Custom tables: Have UUID schema identifiers (e.g.,
ec7b2dea-9383-49d4-b22d-52e04659e28b)
Step 2: Create a Form
Use the project ID (9ba6681e-1952-4d54-aac4-9de6d9858dd4) and template ID (2f634a22-779d-4930-9f08-8391a41fea05) to create a form by calling POST forms.
Request
Response
Note the form ID (932da979-e537-4530-b8aa-18607ac6db37) which you’ll use in the following steps.
Step 3: Update Regular Form Fields (Non-Tabular)
Now update the regular form fields using the v2 batch update endpoint. Use the field IDs (uid values) from the section items you retrieved in Step 1 by calling GET sections.
For this example, assume your form has a “General Information” section with the following fields (retrieved via GET sections): - Weather Condition field (uid: a184ac19-01b5-250e-43d3-56c63b61f952) - Temperature field (uid: b295bd2a-02c6-361f-54e4-67d74c72g063) - Safety Check Complete field (uid: c3a6ce3b-13d7-472g-65f5-78e85d83h174)
Call PUT v2 values:batch-update with the form ID (932da979-e537-4530-b8aa-18607ac6db37).
Request
Response
Field Value Types
When updating form fields, use the appropriate value type based on the field’s valueName from the section details (GET sections):
textVal: Text fieldsnumberVal: Number fieldschoiceVal: Single-select dropdownsarrayVal: Multi-select fieldstoggleVal: Preconfigured responses (Yes/No, Pass/Fail, etc.)dateVal: Date fields (format: YYYY-MM-DD)svgVal: Signature fields (base64 encoded SVG)
Step 4: Update Native Table Values
Now add data to the native tables (work log, materials, and equipment). Use the v2 batch update endpoint with tabularValues.
Request
Response
Understanding Native Tables
Work Log Table (worklogEntries)
Tracks labor on the project:
trade(textVal): Crew or trade nametimespan(timespanVal): Total hours in milliseconds (e.g., 28800000 = 8 hours)headcount(numberVal): Number of workersdescription(textVal): Work performed
Materials Table (materialsEntries)
Tracks materials used:
item(textVal): Material namequantity(numberVal): Quantity usedunit(textVal): Unit of measurementdescription(textVal): Additional details
Equipment Table (equipmentEntries)
Tracks equipment usage:
item(textVal): Equipment nametimespan(timespanVal): Hours used in millisecondsquantity(numberVal): Number of unitsdescription(textVal): Additional details
Important Notes
- Each row must have a unique
id(UUID format). Generate a new UUID for each row. - For native tables, you can use either
columnNameorcolumnIdto identify columns. - The
schemafield identifies which table you’re updating (worklogEntries, materialsEntries, or equipmentEntries). - Time values use
timespanValin milliseconds (1 hour = 3,600,000 milliseconds).
Using columnId for Native Tables
As an alternative to columnName, you can use columnId to reference columns in native tables. This is useful if you have the column UIDs from the section details (GET sections).
Here’s an example using columnId instead of columnName for the work log table:
Both approaches (columnName and columnId) work for native tables, so you can choose whichever is more convenient for your implementation.
Step 5: Review Custom Table Layout from Step 1
Custom tables are defined in the form layout. From Step 1, when we called GET sections, we identified a custom table in the “Equipment Inspection” section with:
-
Table UID:
d4b7df4c-24e8-583h-76g6-89f96e94i285 -
Schema:
ec7b2dea-9383-49d4-b22d-52e04659e28b(UUID format) -
Columns:
- Equipment Name (uid:
e5c8eg5d-35f9-694i-87h7-90ga7fa5j396, type: text_val) - Inspection Date (uid:
f6d9fh6e-46ga-7a5j-98i8-01hb8gb6k4a7, type: date_val) - Status (uid:
g7eagi7f-57hb-8b6k-a9j9-12ic9hc7l5b8, type: text_val) - Inspector Notes (uid:
h8fbhj8g-68ic-9c7l-bak-23jd0id8m6c9, type: text_val)
- Equipment Name (uid:
Key Differences from Native Tables
-
Custom tables use a UUID as the
schemaidentifier (not a predefined name like worklogEntries) -
Must use
columnId(the column’s UID) to identify columns -columnNameis not supported for custom tables -
Column types map to value fields:
text_val→textValnumber_val→numberValinteger_val→integerValdate_val→dateValtime_val→timeValtimespan_val→timespanValarray_val→arrayValuid_val→uidVal
Step 6: Update Custom Table Values
Now add data to the custom equipment inspection table using the UUID schema and column UIDs from the section details (retrieved in Step 1).
Request
Response
Step 7: Retrieve Table Values
You can retrieve values from a specific table using GET table values. Use the table’s UID from the section details you retrieved in Step 1 (GET sections).
For the custom equipment inspection table, use the table UID d4b7df4c-24e8-583h-76g6-89f96e94i285.
Request
Response
This endpoint is useful for:
- Retrieving large tables with pagination
- Getting the current state of a table without fetching the entire form
- Working with tables that have many rows
Step 8: Delete Table Values
To delete rows from tables, use the v2 batch delete endpoint. You can delete rows from both native and custom tables.
Call POST v2 values:batch-delete with the row IDs and schema identifiers.
Request
Response
The default response returns the updated form metadata without the detailed table values:
The specified rows have been deleted. To include the full form values in the response, add includeNativeFormValues=true to the query parameters.
Optional Response Parameters
You can control the response using query parameters:
excludeFormResponse=true: Returns HTTP 204 with no body (faster for bulk operations)includeNativeFormValues=true: Includes the full native form values in the response
Example with no response body:
This returns HTTP 204 No Content with no response body.
Congratulations!
You have successfully completed the workflow for working with form layouts and custom tables. You learned how to:
- Retrieve form template and layout information
- Identify custom tables and their column structures
- Create a new form instance
- Update regular form fields with different value types
- Add data to native tables (work log, materials, equipment)
- Add data to custom tables using column IDs
- Retrieve table values with pagination
- Delete rows from both native and custom tables
Next Steps
- Explore the Forms API reference documentation for more details on available endpoints
- Learn about form submission workflows
- Review the Forms help documentation for information about template configuration and permissions
Imported from the Autodesk Platform Services documentation: https://aps.autodesk.com/en/docs/acc/v1/tutorials/forms/manage-layouts-and-tables.