How to add excel file in dictionary through invoke method uipath

how to add Excel File(Output) In Dictionary Using Invoke Method

Author is Key & Rating Should Be Value

Books List.xlsx (16.6 KB)

Hello @Krishan_Rapswal
Kindly Refer to this thread, you may get some idea.

Hey @Krishan_Rapswal

Hope this is usefull

Another alternative is

where you can read the excel then apply for each row in data table to make it dynamic.

Hope this will help
Cheers.

4 Likes

You could also use LINQ:

dict = dt.AsEnumerable.ToDictionary(Function(r) r("Author").ToString, Function(r) r("Average of rating").ToString)

I have 90 rows how i will add the data in this
using for each ?

and in starting we have to use read range activity right?

@Krishan_Rapswal

Something like this

image

Give row(“ColumnName”).tostring as key that you want to add and also Give row(“ColumnName”).tostring as Value

Hope this helps you
Cheers.

there is no add to collection option in activity
and what to find in packages?

@Krishan_Rapswal

Maybe it is not present in the current package

image

Its available in this one.

Cheers.

so what to use now
how to do it

@Krishan_Rapswal
you can use add to collection
just keep the version as 20.10.4

That will do it.

Books List.xlsx (10.8 KB)

How to change value in the code(Like If i change 4.5 and replace with 4.9 so it will change in Excel File) so it will automatically change in Excel File

Hey @Krishan_Rapswal

You can change if its in key value of a perticular value pair use assign
Something like this

image

And then if you want to change this in excel you have to use write range to change or else it wont reflect there.

You need to get it as data table type to write in excel.

Hope this helped you :slightly_smiling_face:
Cheers.

Value is not changing while using the wringe range

Can We Filter The Data from the Excel Sheet if we need more than equal to “4” Rating how we do it

@Krishan_Rapswal
Yes you can do that
Do read range of excel
Use filter data table activity
In rows select keep Average rating > 4
Something like this

Regards,

Books List 1.xlsx (17.9 KB)

Main.xaml (9.4 KB)

not changing in the value

@Krishan_Rapswal
Try this
image

Main (2).xaml (10.8 KB)

Regards,

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