Insert row action
- Updated: 2024/04/15
Insert row action
The Insert row action enables you to insert a row into the table.
Settings
- Click the Data table name drop-down menu and select a data
table.
If there is no existing data table, create a new variable of type Table.
- Use the Insert row at index field to select one of the
following positions in the data table for inserting the row:
- first position: to insert a row in the first index.
- last position: to insert a row in the last index
-
specific index: to insert a row in the specific
index.
Index refers to the specific row or column in the data table, and starts from 0. For example, index = 0 refers to the first row in the data table.
- Click the Row record name drop-down menu and choose an
existing record variable to hold the values for the new row that you want to
insert.If there is no existing variable, click the Create variable icon to create a record variable.
- Enter a name for the new variable in the Name field.
- Select the following options based on your requirement:
- Use as input: The variable holds a value that can be passed from the parent bot to a child bot.
- Use as output: The variable holds a value that can be passed from a child bot to the parent bot.
- Constant (read-only): If you want to ensure the variable value cannot be edited or overwritten.
- Set schema: To select a schema for the record fields.
- In the Default value section, click
Add.
Enter the name, value, and the type of value that you want to add to the new row as per the specified index values. Click Add in order to insert multiple values.
Note: A DataTable variable is created with one row and one column (1x1) by default. This default value is retained along with the row data that you added using the first position, last position or specific index option.
Consider a scenario where you want to insert a row record named 'March' at the beginning
of a data table called 'Sales'.
- Click the Data table name drop-down menu and select Sales.
- Under the Insert row at index field, select first position.
- Click the Row record name drop-down menu and select March.
- Click Save.