How To Add New Value(Data Row) to Existing Datatable – UiPath

Sometimes while working with DataTable, we might want to add new data to our existing DataTable. Let’s see how to do that!!!

Example

Implementation using UiPath : Step 1: Drag “Build Datatable” activity into the designer panel, to build our sample DataTable ans save the output into a variable called dt_sample.   Step 2: Drag “Add Data Row” activity into the designer panel, and pass the values into it as shown in the figure below. Because in the existing datatable that we have with us, there are only two columns. This is how we have to pass the values into it using the activity’s properties.
{“Alex”,”Boston”}
Step 3: Drag “Output Data Table” activity into the designer panel, and pass the above final modified datatable “dt_sample to it(The only purpose of “Output Data Table” activity here is to convert the datatable content into string type, So that it can be displayed on the screen using a message box).   Step 4: Use “Message Box” activity to display the updated Data Table. Step 5: Finally, execute the workflow and observe the output carefully 🙂   Hope it has helped you

1 thought on “How To Add New Value(Data Row) to Existing Datatable – UiPath

  1. Bhavani Srinivasan

    Also, could you tell me how to add a data row on the top like as headers? Thank you.

Leave a Reply

%d bloggers like this: