What is Wrong With This ConfigFile
Main.xaml (8.6 KB)
Excel File :-
Books List.xlsx (16.5 KB)
This excel file should be dynamic and stored the data in Dictionary
( If i take another Excel File The program will work and if i change the excel file data it will change according to that )
How can we Change Dictionary (" Object, Object ") as (“String, String”)
March 15, 2023, 9:43am
Give try to this one
AddingToDictionary.zip (1.8 KB)
March 15, 2023, 9:51am
Instead of using add to dictionary activity (Which is currently unavailable in UiPath) You can just add the values to your dictionary by using an assign activity
Create a variable NewDictionary of Type : System.Collections.Generic.Dictionary<TKey, TValue>
While creating dictionary variable you can provide TKey as String type and TValue as Object type which wil become Dictionary<String,Object>
Now You read the data from the excel and iterate using for each row in Datatable activity
Inside for each loop drap and drop assign activity
NewDictionary(CurrentRow("Author).ToString)=Currentrow(“Average of rating”).To String
Now after the loop completes whichever key you provide you will get the corresponding value
Refer the xml I have shared for your reference
March 15, 2023, 9:51am
FYI, in this case, we can easily create dictionary from datatable using LINQ as the following.
dict = Input.AsEnumerable.ToDictionary(Function(r) r("Author").ToString,Function(r) r("Average of rating").ToString)
note: dict is
Input is datatable from excel worksheet
How to Change IDictionary <Object, Object> to , <String, String>
Not Getting anything (I want to store my Excel File in Dictioinary and Configure It )
March 15, 2023, 10:18am
How did you check it? Can you try to set breakpoint after the Assign, then check content of dictionary in Local panel?
March 15, 2023, 10:20am
Go to variables panel
Click Browse for types in the variable type column
Now Type Dictionary< You will get this below option now select string,string
March 15, 2023, 10:24am
drag and drop a log message outside the for each loop and put a brakpoint to it now in the immediate section provide any value for example
You should be able to get the value as 4.3 (as per your input excel)
You can even check the NewDictionary Variable aswell
Books List.xlsx (18.0 KB)
How I Make My Excel Sheet Dynamically Through So The Other Person Can Change The Data from His Personnal Excel Sheet (Using Dictionary)
For Example I have 100 rows in my Excel File but Today he need Only 60 rows With Above Rating “4”
Next day if he wants 30 rows With Above Rating “4.1”
but he is using “His Excel File” to change the Data
March 16, 2023, 8:29am
I have added the input dialogue box to the below workflow where you can provide the average of rating so that it will return only the equal or above that rating.
FilterExcel.zip (2.5 KB)
I believe this resolves your issue. If it meets your requirement.You can mark this as solution and close the topic since many duplicate posts have been created .
Hope this helps,
Books List.xlsx (16.6 KB)
In my excel file i create a excel sheet in which i want to change rows according to requirement mean to say if i want 50 rows today then it will show me 50 rows and tommorow if i need 80 rows then it will give me that data.
In Another sheet i want adjust the rows according to rating Means if i want above 4 rating then it will show that
this should be dynamically (Using Dictionary)
last Condition **
IF i have another Excel file completly different the program will act according to that.
I am New and learning UiPath and i don’t know what to do please help
i have gone through many forum but didn’t find anything, searched Youtube and Google also and
I am sorry for this mess up
March 24, 2023, 10:03am
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.