Writing a Command which does not return a value

Hi,
How to Write a Command which does not return any value. Sample command can be like “outdt.Rows.Add(row)”
So, In the above example, outdt is the ‘datatable variable’; and ‘row’ is the ‘datarow’ variable. All i want is to add a particular row to a datatable.
Is there a way to do so?

yah for that we can use ADD DATA ROW ACTIVITY
where we can mention the datatable name and datarow that we want to add to that datatable

Cheers @Vivek_Kumar

@Vivek_Kumar

Add data row activity → Add the next in the row to add:
{“value of field A”,“value of field B”,“value of field C”,“value of field D”}
etc.

When you add a datarow, you have to fill all the possible columns by its index.

KR,
Pablo

Test22.zip (10.5 KB)
@Palaniyappan
Wasn’t able to work that way too. Can you help further.
There are too many columns. It would practically difficult to insert using “ArrayRow”

@Pablo_Sanchez
It’s practically difficult in my situation, since there are too many columns. Can you suggest any other possible way?

@Vivek_Kumar

If there are much columns, first you should have to read a row with data (whole columns musnt be filled, it doesnt matter) and then change the desired columns using columnIndex.

The thing is that UiPath wont know how many columns has your row, and if you aren’t writting all the columns fields as I said above, you will have to read a similar row, then change it, and once its changed, add to the datatable.

KR,
Pablo

@Vivek_Kumar
There can be found a lot options to made it easier / more transparent, just let us know your requirements

@Pablo_Sanchez
I suggest to use new row, so its not prefilled with old data

@Vivek_Kumar
Simply use the Invoke Method activity.
TargetObject will be outdt.Rows.
MethodName will be “Add”.
You can pass the row in through the Parameters collection.

1 Like

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