How to get a value from a dictionary?

Hi guys,

A data input I’m working with is in the format of a “double” dictionary. My dictionary is in the following format: System.Collection.Generic.Dictionary<System.String, System.Object>[] also mentioned as Dictionary’2[].

A sample of data could be like this:

Dictionary<string, object>[1] 
{
  Dictionary<string, object>(5) 
  { 
{
  "Planning_x0020_date",
  [06/18/2019 22:00:00] 
},

{
  "Additional_x0020_days",
  120 
},

{
  "Last_x0020_Modified",
  "2019-06-19T11:45:22Z" 
},

{
  "Created_x0020_Date",
  "2019-06-19T11:45:22Z" 
},

{
  "FSObjType",
  "0" 
},

  }
}

I want to make a for each loop to get the value from Additional_x0020_days

How would you do that?:grinning:

Hi @celfa

Is there a reason you created a dictionary within a dictionary?

Sounds Good if your Have a List<Dictionary<String,Object>> instead a nested Dictionaries :slight_smile:

@nlee1131 I’m using the SharePoint packages from Go https://go.uipath.com/component/sharepoint-custom-activities-package

And the output from this activity is in that kind of format (Dictionary’2[]).

Maybe the developers @Diana_Mincu and @radu_bucur knows how to handle it? I’ve looked at the documentation(package documentation), but without any luck.

Something like This?
image

I guess so, but how can I do this in UiPath?

Hi Celfa!
Thanks for using our package, you made me and @Diana_Mincu feel useful for once :smile:

I attached here a code sample where you can see how to process the data returned by the Read List Items activity (read properties and loop through all the properties in a dictionary)
Main.xaml (10.8 KB)

Good luck and let me know if I can help further :slight_smile:

2 Likes

Thank you :smile:

Now it works perfectly! :+1:

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