How to insert data dynamically in data table

Hi,

I am new to uipath and i am referring the Training material provided by them and try to do exercise 18 part b and following the same steps and try to insert the values automatically through that but it is showing some error to me.
Can anyone tell me how to insert values dynamically in my existing table through uipath.

Regards,
Jasnoor

Hi,
please follow this.

1 Like

Hi @ddpadil,

I have tried it, its not working the way i want.

Regards,
Jasnoor Kaur

Hi,
Please attach the workflow.

Hi @ddpadil

@Jasnoor
You can add values as a row in Data Table by using the activity Add Data Row, in this case the data you were inserting should match the existing Data Table Structure.Activity Add Data Column is to insert new column to the data table.
To modify data in particular cell you can use Assign activity, data_table.rows(row_index)(column_index)= value

1 Like

Hi @ranjith,

Can u please provide me an example by doing this, if possible.

Regards,
Jasnoor

haha oh boy :roll_eyes: your taking about database and we’re assisting on excel data table. :rofl:

Got confused with Database and Data Table :smile: , @Jasnoor you’re facing error in Database not data table

Hi @ranjith, @ddpadil,

I am trying to fetch the data from an excel sheet or you can say csv file format and trying to insert those values in my table and facing issues in that.

Ok anyways .:wink:
then you need to use Alter Table

ALTER TABLE table_name
ADD column_name column-definition

then use insert query

1 Like

Hi @ddpadil,

I am getting this error which i was facing:
Insert : Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information.

Regards,
Jasnoor

just make sure insert query has the only those columns which are existed in database table.(Excel columns and database table columns has to match.)

Hi @ddpadil,

They are exactly matching.

Looks like your table doesn’t have a primary key, you need to set one and check

Hi @ddpadil,

The primary key is there in my table.

Do you mind trying with “Execute non query” activity
adding to that just make sure you must have similar data type and same property as that of database
if db column datatype is int then you excel column must have int.
similarly what if primary column name in the excel has same values like “10” “10” then db doesn’t accept such value

Hi @ddpadil,

Do you mind, if u once try to solve the problem given in the training material of UIPath 18 part b
UiPath Academy - Session 18 - Databases - Practical Exercises.docx - Google Docs
exercise 2.

plz share this sample

Hello ,

We are facing the below error when we are using Insert activity to insert datatable into DataBase.
Although we have same column name in Excel and in database table.