How to cast Object to IEnumerable for looping in For each?


#1

I have a dictionary dictConfig<String,Object>. I am opening 4 PDFs using Open Application and storing those PDFs windows inside window variable. Now, I am creating a list of windows listAdobeReaderWindow<UiPath.Core.Window> and storing all windows variable inside my listAdobeReaderWindow variable. This list is then inserted into dictionary. dictConfig(“AdobeReaderWindow”) = listAdobeReaderWindow.

I wanted to use this key dictConfig(“AdobeReaderWindow”) in a for each activity. Since this key’s value is an object, how can i convert this object into an IEnumeration.


#2

HI @Rohit,
Here I have attached a sample for a fix.

File :
ObjectToIEnumerable.zip (2.4 KB)

Regards
Balamurugan


#3

Perfect :+1::+1:!!! Thanks @balupad14 for the solution.:grinning::grinning: