Меню

Add row
This activity is found in subsection Collections-Table.

Set the following Properties:
  • Line – set in dictionary format, where key is the name of the column;
  • Position – end – add after the last row, start – add before the first row;
  • Create columns – true - keys that are different from the headers are moved to new columns, false - ignore difference;
  • Table – name of the table in which we add the row.

Example.

Let's look at an example of adding a row to an empty table.
The result should be the following table:


1. Use the "Create table" activity to make an empty table.
In the Properties specify data structure of two columns named "A" and "B" respectively.
Here the variable table is specified in the "Table" property.

2. Since a string needs to be added as a dictionary, let's create a dictionary object using the "Create Dictionary" activity.
In the properties, click "Edit" to add entries to the dictionary.
Add two entries:
  • Key - A : Value - 1
  • Key - B : Value - 2
This means that when we'll be adding to the table, we'll add in column "A" the number 1 and in column "B" the number 2.


3. Add the "Add row" activity.
In the "Line" property add the variable that contains the dictionary (in this example dict). Also in the "Table" property add the name of the variable that contains the table that we want to add the row to (in this example table).

We now have the following sequence of steps:

4. Run the script. Use the Debug mode to check the contents of the table.


As you can see, we have successfully added the row to the table.