How to upload the extracted data to the database?

Hi All,

I am currently working on a Project which needs to be login to an app and extract the required data and write the extracted data into the output database.

Currently I extracted the required data from the app and storing each extracted data in a variable.
I am storing around 10 to 12 data in to the variables.

But I am not getting how to write this extracted data in to the mssql databse, please someone guide me how to achieve this??

@Nitya1
@ppr
@Yoichi
@ushu
@vishal.kp
@Anil_G

Hi @Vrishchik

You can try to do this by connecting to the database by building appropriate connection string & then run a query to insert the data into the database.

Hope this helps,
Best Regards.

1 Like

I have already created the connection between DB and UiPath also I have created the table with only headers(in the same table I need to write the extracted data.

@Vrishchik

You can add the extracted data to the created table using Add Datarow activity & then push it to the db.

Best Regards.

1 Like

Ok, whether I need to use the add datarow activity inside the for each row or I need to use without for each row activity??

Hi @Vrishchik ,

Here’s an approach:

  • Use build data table activity and create a data table with all your required headers
  • Add the data in variables to the data table by using the add data row activity under respective columns.
  • Use the insert activity, specifying the database table name and the data table
  • Insert activity will also provide you with the result after the inserting is done

Regards

1 Like

Ok, whether I need to use the add datarow activity inside the for each row or I need to use without for each row activity??
Because I am using the Re framework

If you are passing one row at a time to the database, then no need to use a for each. Just use the add data row and then pass it to data table thereafter database. This will be handled in the Re Framework @Vrishchik

Regards,

1 Like

Hi @Vrishchik

To write the extracted data into an MSSQL database in UiPath, you can follow these steps:

  1. First, you need to establish a database connection. You can use the “Connect” activity from UiPath.Database.Activities package to establish a database connection. You will need to provide the necessary database credentials and connection string information.
  2. Once the connection is established, you can use the “Execute Query” activity to write the extracted data into the database. You will need to write an SQL query that inserts the data into the appropriate table in the database.
  3. In the “Execute Query” activity, you can pass the SQL query as a parameter and provide the input data as variables. You can use the variables that you have already extracted and stored to pass the input data.
  4. Finally, you can use the “Disconnect” activity to close the database connection.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.