Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)

I am creating a UI Path bot and using the Excel Read column activity to read contents of a column. I want to use this as text to use somewhere down the line but now the Excel read Column activity outputs an IEnmerable(Object) and I want to pass this to a variable that is a string. So far I am getting an error when I use the following:

myTextString = CType(myIEnumerableObject, String)

or

myTextString = myIEnumerableObject.ToString  (this is simply stored as System.Object)

or

myTextString = CStr(myIEnumerableObject)

What I need is to be able to convert this object to a string, store it in a string variable and be able to re-use it later.

Thanks

1 Answer

0 votes
by (29.5k points)
you could try the following to rectify the issue

String.Join(<seperator>,myIEnumerableObject) in an Assign activity, where <seperator> specifies the seperator between each element in your IEnumerable:

String.Join(",",myIEnumerableObject) provides a comma separated string.

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...