How to insert new row into data table using Automation Anywhere

 RPA | A2019 Insert new row into Datatable| Automation Anywhere - Part-33

A2019 Insert new row into datatable  - Today in this article we will discuss how to insert new row into datatable using A2019 Automation Anywhere.

So first of all let us discuss the objective that what we will achieve with this blog. So the main objective of this blog is that it will guide you through each and every step that you may follow while inserting a new row into the datatable and then write the datatable data into the excel file stored at a particular location.

The various steps that are required for inserting of new row into the datatable are given below.

  • Open the URL i.e. "http://coredogs.com/lesson/web-page-tables.html" using the open action present under the browser package.
  • Now drag and drop the capture action present under the recorder package and capture the table present on the website and from the actions drop-down menu select Get table action and store the output in a variable which should be of table data type.
  • From the data table package select the insert row action. In the properties section select the data table name that we created in the previous step and select where you want to insert the new row i.e. at the very beginning or at the last position or at the specific index and store the output in a record variable data type.
  • Next drag and drop the assign action from the string package and assign the value and store the output in a string variable data type. Repeat this action for each header present in the table captured.
  • Now drag and drop the set value of single cell action from the data table package. In the properties section give the data table name, then pass in the row index and the column index and in the set value of single cell field pass in the variable name created for that particular header in the previous step. Again repeat this action for each header present in the table.
  • Open the excel file using the Open action present under the excel advanced package.
  • Now create the number variable data type and assign it a default value of 1.
  • Loop through each row of the data table using the loop action present under the loop package.
  • Convert the number created variable into the string variable using the number to string action under the number package and store the output in a string variable data type.
  • Using the set cell action present under the excel advanced package set the value of each header present in the data table variable.
  • Increment the number counter variable by 1.
  • Close the excel file after the data is written into the excel file using the close action.

The below picture represents or depicts the code snippet for the above steps that we have discussed.
Insert new row into data table A2019 Automation Anywhere





So with that we come to the end of this article on how to insert new row into the data table using A2019 Automation Anywhere which now is known by the name as Automation 360.

You can share your feedback regarding this article by posting your feedback in the comment section.

Comments