How to get several "get row item" in UiPath

Hey @MichaelC

You can use Generic data type as an output vairable for “Get Row Item” Activity because when you will use “Ctrl+k” it will create a variable of Generic data type for that activity but still you can use string data type as well depends on input excel data datatype.

For your reference : Sample.zip (6.9 KB)

Regards…!!
Aksh

thanks for your reply. I can perform “get row item” as well. what I cannot perform is to get multiple row items…may I know if UIPath hv similar function of getting multiple row items and save to different string output? thanks~

1 Like

If i am not getting you wrong you wants to use Multiple times “Get Row Item” Activity?? or? something else?
Check that sample.zip again. It works…

Regards…!!

1 Like

Hi @aksh1yadav . I have the same question as @MichaelC

If I need to "get row item’ for 30+ variables, is there a shortcut way or do I need to individually setup 30 “get row item” activities? For example, is there a way to write a script for this?

Why can’t you use the DataTable variable(arguement) all through the project?

For eg: The below will return the Age column value from 1st row

dt.Rows(0)(“Age”).ToString

or you can use foreach whereever you need.

  1. You can get the row values in a dictionary and pass it as arguments to multiple workflows.

    Dictionary<String, String> items = new Dictionary<String, String>() {
    {“name 1”, “value 1”},
    {“name 2”, “value 2”}
    {“name 3”, “value 3”}
    };

1 Like

Thank you @vvaidya . I have not used arguments or dictionary until now. I will work through the examples:

here for arguments and,
here for dictionaries

Hi @aksh1yadav, is it possible to use get row item ones and select all the columns for that row. If I have over 50 columns, its quite troublesome to get row item for each column over 50 times.

1 Like

Hey @tobor, @MichaelC and @ZacZ

Yeah i have a way,

Please find below attached sample workflow and let me know if any doubts you have :slight_smile:

Single_GetRowItem_to_fetch multiple_columns.zip (15.9 KB)

Regards…!!
Aksh

Hi @aksh1yadav, it looks great! just a quick question, im pretty new to UiPath, where can I find all the functions like dt1.Columns.Cast(Of DataColumn).Select(function(x) x.ColumnName).ToArray(). Im not sure which are the syntax that are compatible in UiPath :slight_smile:

Btw how do I paste them into excel workbook in the same format? I don’t really know how to iterate row by row, so currently if I use add data row, all the information will be in one column instead of row by row

what you wants to paste?

Regards…!!
Aksh

@aksh1yadav basically im trying to select certain entries and write those rows to another excel workbook. The video tutorial from the website shows how to do that if there are a few columns, Excel Automation Tutorial - DataTables Automation | UiPath, for this video, the last example is what I am trying, just that instead of the 3 columns, is there a way to read multiple columns at the same time instead of creating a get row?

what i am getting is you want to store data(By using Add Data Row?) into datatable so you can write it into an Excel file ???

Video is not playing because of security policy.

or still facing problem with the above thing?

Yes that’s right @aksh1yadav

This link will help you on this:

just pass that datatable to a write range activity inside an excel application scope.

Regards…!!
Aksh

1 Like

Hey hi @aksh1yadav I just need explanation for the code " dt1.Columns.Cast(Of DataColumn).Select(function(x) x.ColumnName).ToArray()." what is that function(x).? what x stands for?? Please reply me as soon as possible. because i need same line of code to extract data…

regards,
Praveena

Hello mate, what is the variable type that you have selected for col_name variable?

You can see it in variable pane easily.

as you asked - It is String[ ](String Array).

Regards…!!
Aksh

Sorry for late reply. Did not get notification sometimes :slight_smile:

x is a lambda expression that returns whatever argument it’s provided with.It’s equivalent to a method declaration.

Regards…!!
Aksh

It is also known as the identity function

@aksh1yadav Hi, Please can you explain the code item.ToString+"="+data I need it for some work.

hey @narayan_shrawagi

That was for debugging to check the values what i am getting :slight_smile: nothing much .

Regards…!!
Aksh