Datatable To CSV File Using UiPath Studio

Robotic Process Automation is the technology that allows anyone today to configure computer software, or a “robot” to emulate and integrate the actions of a human interacting within digital systems to execute a business process.
 
RPA robots utilize the user interface to capture data and manipulate applications just like humans do. They interpret, trigger responses and communicate with other systems in order to perform on a vast variety of repetitive tasks. Substantially better: an RPA software robot never sleeps and makes zero mistakes.
 
UiPath is a leading Robotic Process Automation vendor providing a complete software platform to help organizations efficiently automate business processes.
 
UiPath Studio is a tool that can model an organization's business processes in a visual way.
 
Reading this article, you can learn how to create a datatable, store the data into a datatable,  retrieve the data from the datatable and write the data into a CSV file with Assign, Do While, Add Data Row and Write CSV activities using UiPath Studio Pro Community.
 
The following important tools are required for developing UiPath Bots,
  1. Windows 7/8.1/10 (Recommended)
  2. UiPath Studio Pro - Community Cloud (It is a free software available online –https://www.uipath.com/start-trial)
Now we can discuss step by step app development.
 
Step1
 
Open UiPath Studio -> Start -> New Project-> Click Process
 
Datatable To CSV File Using UiPath Studio
 
Step 2
 
Now, create New Blank Process , Name as UiDatatable and give your Description
 
Datatable To CSV File Using UiPath Studio
 
Step 3
 
After that UiPath studio creates the project UiDatatable with supporting files.
 
Datatable To CSV File Using UiPath Studio
 
Step 4
 
Next , for storing data to a Datatable, create a new sequence workflow named  Testdatatable,
 
Datatable To CSV File Using UiPath Studio
 
Create a Datatable variable named Datastore,
 
Datatable To CSV File Using UiPath Studio
 
Similarly, create 3 variables, with Name as String, MobNo as Int32 and City as String  for values for local variables storing data in datatable,
 
Datatable To CSV File Using UiPath Studio
 
Click Activities -> search Buid Data Table activity->Drag and drop into sequence,
 
Datatable To CSV File Using UiPath Studio
 
Click the Datatable and create 3 columns based on our data like Name, MobileNo and City, 
 
First, click Edit column icon and Column name as Name, Datatype as String and click ok 
 
Datatable To CSV File Using UiPath Studio
 
Similarly, create another two variables, MobileNo and City
 
Datatable To CSV File Using UiPath Studio
 
Set the output Datatable as Datastore,
 
Datatable To CSV File Using UiPath Studio
 
Create one more local variable count for record
 
Datatable To CSV File Using UiPath Studio
 
Click Activities -> search Assign activity->Drag and drop into sequence and set the value,
 
Count = 0
 
Datatable To CSV File Using UiPath Studio
 
Click Activities -> search Do While activity->Drag and drop into the sequence,
 
Datatable To CSV File Using UiPath Studio
 
Click Activities -> search Assign activity->Drag and drop into the sequence and assign
 
Count = Count +1
 
Datatable To CSV File Using UiPath Studio
 
Click Activities -> search Add Data Row activity->Drag and drop in to sequence,
 
Datatable To CSV File Using UiPath Studio
 
Set the INPUT -> Array Row Property value in Add Data Row, {“Vijay”, 123456789, “Namakkal”}
 
Datatable To CSV File Using UiPath Studio
 
Set the INPUT -> Datatable Property value as Datastore in Add Data Row
 
Datatable To CSV File Using UiPath Studio
 
Set the Do While Loop condition as count > 5 for storing 5 records in Datastore Table,
 
Datatable To CSV File Using UiPath Studio
 
Click Activities -> search Write CSV activity->Drag and drop into sequence,
 
Datatable To CSV File Using UiPath Studio
 
Set the Write to what file property and Write from property in Write CSV activity for displaying the data in the Datastore table,
 
Datatable To CSV File Using UiPath Studio
 
Step 5
 
For running your project, Select debug file -> Run,
 
Datatable To CSV File Using UiPath Studio
 
The output of the UiNotepad project is, Click the Folder icon in Project tab and find the newly created file test.csv
 
Datatable To CSV File Using UiPath Studio
 
Open test.csv file, the file contains 5 records,
 
Datatable To CSV File Using UiPath Studio
 

Summary

 
Now, you have successfully created and tested a Datatable and displayed the stored values in a .csv file using UiPath Studio.


Similar Articles