Skip to main content
Version: 1.28 (Current)

Datasource Inline Add

Audience: Low-code Engineers

Skill Prerequisites: Actions, Listings

Adds a new, empty row to a Listing, so users can type the values right in the table and save them without opening a form.

Put it on a root button. When the user clicks Save, the Listing inserts the new row into its data source, then runs the On Save actions for that row. The ID of the new entry is available to those actions.

Typical Use Cases​

  • Add simple records, such as categories or lookup values, directly in the Listing
  • Enter several new rows before saving them all at once
  • Run extra logic after each new row is inserted, for example creating related records with the new ID

Don't use it to​

Action NameDescription
Datasource Inline EditMakes existing rows editable in the Listing.
Datasource AddOpens the data source's add page.
Datasource RefreshReloads the Listing's data.
Run SQL QueryRuns SQL, for example in On Save to create related records.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
On SaveActions that run after each new row is inserted into the data source. The row's values are available as tokens named after the columns, for example [Title]. The new entry's ID is available through the token named after the data source's ID column, for example [CategoryId]. Use these actions for extra logic only. The insert itself is already done.NoemptyNo

Setting up editable columns​

The new row only has inputs for columns with an inline edit field. Set it in the Listing's field settings, under Inline Edit, the same way as for Datasource Inline Edit. Validation rules set there are checked before anything is saved.

How saving works​

  1. The action adds an empty row and puts the Listing in add mode. Paging is hidden until the user saves or cancels.
  2. The user fills in the row and clicks Save, or Cancel to discard it.
  3. All rows are validated first. If any field fails validation, nothing is saved and the errors are shown next to the fields.
  4. For each new row, the data source inserts it, then the On Save actions run.
  5. The Listing leaves add mode and reloads its data.

How the data source inserts the row depends on its type:

Data sourceWhat happens on saveNew ID in On Save
Database TableBuilds an INSERT statement from the submitted values that match table columns.Yes
SQL Advanced QueryRuns the SQL Query for Inserting Items set on the data source, with the row values as tokens. If it's empty, nothing is saved.Yes, for SQL Server connections. Not for ODBC connections.
SQL SelectRuns the SQL Query for Inserting Items set on the data source, with the row values as tokens. If it's empty, nothing is saved.Yes
Server Request (JSON)Nothing is saved. Do the insert yourself in On Save.No

Considerations​

  • Final action. Actions placed after Datasource Inline Add on the same button don't run. Put follow-up logic in On Save.
  • No On Complete. Unlike Datasource Inline Edit, there's no list that runs once after all rows are saved.
  • Errors in On Save stop the save. If an On Save action fails, the error is shown and the remaining rows aren't saved. Rows inserted before it stay inserted.
  • Returning the ID from SQL. For SQL Advanced Query (on SQL Server connections) and SQL Select, SELECT SCOPE_IDENTITY() is added to your insert query automatically, and its value becomes the new ID. Write the insert query without a trailing SELECT.
  • ODBC connections. The new ID may not be available in On Save when the data source uses an ODBC connection.
  • Table view only. Inline adding works in the Listing's table view.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Add a category and create its default settings​

Add this action to a root button. The user types the new category in the Listing. After the row is inserted, On Save uses the new [CategoryId] to create a settings record.

{
"Title": "Datasource Inline Add",
"ActionType": "DataSource.InlineAdd",
"Description": "Add a category inline",
"Parameters": {
"OnSave": [
{
"Title": "Run SQL Query",
"ActionType": "RunSql",
"Parameters": {
"SqlQuery": "INSERT INTO CategorySettings (CategoryId, IsVisible) VALUES (@CategoryId, 1)",
"BindTokens": [
{ "name": "CategoryId", "value": "[CategoryId]" }
]
}
}
]
}
}

Revised 09/26/2026