How to insert data dynamically in data table

datatable

#1

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


#2

Hi,
please follow this.



#3

Hi @ddpadil,

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

Regards,
Jasnoor Kaur


#4

Hi,
Please attach the workflow.


#5

Hi @ddpadil


Insert csv rows to database
#6

@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


#7

Hi @ranjith,

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

Regards,
Jasnoor


#8

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


#9

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


#10

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.


#11

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

ALTER TABLE table_name
ADD column_name column-definition

then use insert query


#12

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


#13

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.)


#14

Hi @ddpadil,

They are exactly matching.


#15

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


#16

Hi @ddpadil,

The primary key is there in my table.


#17

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


#18

Hi @ddpadil,

Do you mind, if u once try to solve the problem given in the training material of UIPath 18 part b
https://docs.google.com/document/d/1q3SB-omUbaAwd6--RndXw_kawyQ5SOra5B9NFOVcV68/edit
exercise 2.


#19

plz share this sample