Update Row

Verb: updateRow

Available from: <Standard>

Updates existing values in a specific table row.

Syntax

updateRow --index(Numeric) [--valuesmapping(String)] [--valueset(StringDictionary<String>)] --dataTable(DataTable)

Inputs

Script Designer Required AcceptedTypes Description
--index Index Required Number Number that indicates the position of the row that should be updated.
--valuesmapping Values mapping Optional Text Updates the column, mapped in the "Parameter" field, of a specific row with the value entered in the "Value" field.
--valueset Values set Optional String Dictionary<Text>, List<Primitives> List of values that are used to update the row specified in Index.
The values update the row in sequence, that is, the first value updates the first column, the second value, the second column, and so on.
--dataTable Data table Required Data Table Data table that should have a row updated.

Example

Example 1: Updates a specific row of the table with the value that was entered in the value mapping.

defVar --name excelFile --type Excel
defVar --name excelSheet --type DataTable
// Table filled with values.
excelOpen --file "tableExcelCompanyCity.xlsx" excelFile=value
excelGetTable --file ${excelFile} --getfirstsheet  --entiretable  --hasheaders  excelSheet=value
//
updateRow --index 3 --valuesmapping "City=Brasília" --dataTable ${excelSheet}
excelClose --file ${excelFile}
logMessage --message "${excelSheet}" --type "Info"
// The example above returns the following output:
// Company, City
// IBM Corporation, Toronto
// Microsoft Corporation, São Paulo
// IBM Corporation, Brasília

Example 2: Updates a specific row of the table according to the data in a text list.

defVar --name excelFile --type Excel
defVar --name excelSheet --type DataTable
defVar --name valuesList --type List --innertype String --value "[Google,Califórnia]"
// Table filled with values.
excelOpen --file "tableExcelCompanyCity.xlsx" excelFile=value
excelGetTable --file ${excelFile} --getfirstsheet  --entiretable  --hasheaders  excelSheet=value
//
updateRow --index 3 --valueset ${valuesList} --dataTable ${excelSheet}
excelClose --file ${excelFile}
logMessage --message "${excelSheet}" --type "Info"
//The example above resumes the following output:
//Company, City
//IBM Corporation, Toronto
//Microsoft Corporation, São Paulo
//Google, Califórnia

Download File


For the correct operation of the "scripts" above, it is necessary to "download" the file and enter its path in the File parameter of the Open Excel File command.

Remarks

The value entered in the Index parameter must be between 1 and 2147483647.

The value entered in Index cannot exceed the number of rows in the table.

To execute the command, you must enter a value in one of the parameters: Values mapping or Values set. There can't be values in both fields simultaneously.

In Values set, if the number of set values is greater than the number of table columns, those values are disregarded; if smaller, they update to as many columns as possible and the other values of the remaining columns remain unchanged.

See Also

  • Add Column
  • Add Row
  • Check for Column Existence in Table
  • Copy Rows
  • Copy Table
  • Delete Column
  • Delete Rows
  • Filter Table
  • Find Column by Name
  • Find Table Cell Occurrences
  • Get Cell Contents
  • Get Column Name
  • Get Column Structure
  • Get HTML Tables
  • JSON to Table
  • Map Table Row
  • Move Table Rows
  • Sort Table
  • Write Table to File