Learn to use Samsara’s API to pre-populate forms that include table fields. You will learn how to:Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Fetch a form template that includes a table field.
- Create a form submission with a table field pre-filled with data.
This guide assumes you are already familiar with the basics of creating form submissions and the overall Form Submissions API. If you are new to working with forms, see the Create and assign forms guide first.
Table fields
A table field in a Samsara form template allows you to gather multiple pieces of structured data in a grid-like format. Each table has:- Columns that define the Field Type (e.g.,
text,number,multiple_choice) and label. - Rows that represent individual data entries submitted in the form.
fields array with "type": "table". Each table field has its own unique id (UUID) and an internal definition for its columns.
When creating a form submission with a table, supply an array of rows containing the data for each row. The ID of the row must match the ID of the table field.
This form template includes a table for tracking the Order ID and whether the order was received in good condition. Examples below show how to use the API to pre-populate order IDs into the table so that workers can submit forms with the order ID cells pre-filled.
Fetch the form template
To see the structure of a table field (including its columns) and plan how you will submit data, you need to fetch the form template.The response includes the template’s
fields array. Within it, a table field has "type": "table" and a unique id. Each column inside the table specifies its own id, label, and type (such as number, text, multiple_choice, check_boxes, datetime, signature, media, or person).For example, a Forklift Inspection template might define a table with these columns:Understanding the table field in the template
"type": "table": Indicates this is a table field.- The table’s
id: The table field’s unique UUID. Use this in the submission to identify which table to fill in.
Pre-populate a table in a form submission
Use the Create a form submission endpoint to create a new form submission. Pre-populate the table with rows of data by including a
fields array, where each table field has a tableValue property containing one or more rows.Note the key points:- Use the table’s
idfrom the template in thefieldsarray. - Set each row’s
idto the table field’sid(repeated for each row). - Cells: An array of fields representing each column in that row.
Key points
- Row
idmust be set to the table field’sidin every row you include. - Columns are effectively “fields within the table.” Their
idandtypein the submission must match what’s defined in the template. - Partial row data is possible by omitting the cell entirely for that column.
- Pre-population in a submission is similar to filling other fields, except you nest them under a
tableValue.rows[].cells[]structure.