Dynamic Tables
Introduction
The table entry field allows you to collect structured data in a spreadsheet-like format. Here are some features at a glance:
- Fixed or variable rows: Allow users to add or remove rows dynamically, or keep a fixed number of rows with pre-defined values.
- Different input types: Text, numeric, dropdown, date, formula, and read-only text columns.
- Use math formulas: Use the formula column type to add form calculations based on other columns in the same row.
- Fetch data from remote source: Populate some table columns from an external API, Salesforce, or Google Sheets.
- Update rows based on user input: Use lookup rules to filter remote data based on other form field values.
Here are some real-world examples of using dynamic tables:
- A variable-row purchase order form where users can add multiple line items with quantities and prices.
- A variable-row expense report form where users can add multiple expense entries with categories, amounts, and dates.
- Inventory update form where the list of products is fetched from an external API and users can update stock levels.
Let’s dive in.
Column types
Tables support six different column types:
- Input: Standard text input for free-form text entry.
- Numeric: Numeric-only input that optionally allows decimal values.
- Dropdown: Offer a predefined list of options in a dropdown menu.
- Date: Date selection with customizable format.
- Text: Read-only column that displays static text or data fetched from a remote source.
- Formula: Read-only column that displays calculated values based on other columns in the same row. Some use-cases:
- Total price: Multiply quantity and unit price columns to get the total price for each line item.
- Discounted price: Apply a percentage discount to the price column.
- Conditional values: Use IF statements to display different values based on other column inputs.
- Learn more about supported functions →
Row source
Tables support five different row sources, each designed for specific use cases:
Variable rows
Variable rows allow users to add and remove rows as needed. You can specify a default row count, and users can dynamically add more rows by clicking an “Add row” button.
Note: If your table has ‘text’ or ‘formula’ columns with pre-set values, those values will be the same for all rows in variable row mode.
Fixed rows
Fixed rows display a predetermined number of rows that users cannot add or remove.
Note: In fixed row mode, you can set different default values for ‘text’ and ‘formula’ columns for each row.
Remote URL
Fetch table data from any external API endpoint that returns JSON data. This is the most flexible option for integrating with third-party services.
Configuration options:
- Remote URL: Endpoint to fetch data from (supports dynamic parameters so you can reference other form fields using the
@key) - Authorization header (Optional) Bearer token or Basic auth
- Option List Path: JSONPath expression to extract the array of data objects
- Column mapping: Map table columns to fields in the returned data
Test configuration
- Remote URL:
https://api.formcrafts.com/public/options?type=inventory - Option List Path:
$.data[*] - Column mapping:
$.labeland$.value
The Remote URL mode sends a POST request to your endpoint with the current form values, allowing you to return dynamic data based on user input.
Learn more about JSONPath syntax →
Salesforce
Learn more about creating dynamic tables with Salesforce →
Google Sheets
Fetch table data from a Google Sheets spreadsheet.
Configuration options:
- Spreadsheet file: Select your Google Sheets file
- Sheet: Select the specific sheet within the spreadsheet
- Filter rules: Use form field values to filter rows from the sheet
- Column mapping: Map table columns to spreadsheet columns
