Need help to create input dialog "multiple choice" list from Array of Strings

I am trying to use an input dialog box activity to open a webpage. I would like to have my list of webpages come from an excel workbook.

image

The properties of the activity show I can use a variable of type String Array

I created a Read Range activity and then used a foreachRow actvity to loop over my datatable variable. It works in a “Write Line” when I use the expression row("apps).ToString. I get the list in the output panel.

But when I try to assign to a variable of String Array with the expression row(“apps”).ToString.Split(","c).

Then pass that variable to the “Input Dialog” “Option” property. I only get one option and no drop down.

What am I missing?

My Project is attached
Forum Example Input Dialog from variable.zip (10.5 KB)

@psinha11
Something issue in your Loop.

@psinha11
Check:
You were looping and getting last value in the end.
I converted the column into Array and passed that Array to Dialogue
Forum Example Input Dialog from variable (2).zip (11.2 KB)

Hi,

Perhaps you should use List<string> as the following.

Forum Example Input Dialog from variableV2.zip (10.5 KB)

Regards,

Thanks for the solution! The argument below is what I didn’t know how to use.

dt_workbook.AsEnumerable().Select(Function(row) row(“apps”).ToString).ToArray()

@Yoichi Thanks for that example on how to use a list. I can see why it’s easier to read it as list.ToArray(). I went with @raja.arslankhan solution because it didn’t require a foreach loop.

I’ve added your finished example to this post.

@psinha11
Basically your values present in multiple lines one by one. I read all the date in datatable and the I converted your “app” column into Array by putting loop over Datatable.

1 Like

@psinha11
Basically your values present in multiple lines one by one. I read all the date in data table and the I converted your “app” column into Array by putting loop over Data table. This function is linq query

Forum Example Input Dialog from list and foreach to string array variable.zip (10.8 KB)

Forum Example Input Dialog from datatable to string array variable - Final.zip (10.3 KB)

@psinha11
do you want to ask anything?

no thanks, I just posted the final example because it didn’t need a foreach loop. Thanks for the help!

1 Like

@psinha11 Happy Automation

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