How to use items in column as array for "input dialogue"?


How to use items in one column as array for “input dialogue” ? Thx

1 Like

I’m assuming you’re talking about a datarow, and you want to convert each item in the datarow into a string array, then paste it into the ‘input dialog’ activity as either the text or label. Please correct me if any of these assumptions are incorrect.

Assign YourStringArray = dt1(0).ItemArray.Cast(of string).ToArray() // This will give you a string array for each column of the first datarow in datatable called dt1.

Thanks Dave

Input :
Column A
item 1
item 2

item n

I want to use those item list in my “input dialogue” in options field

Just use the assign activity I posted above to save to a string array variable. Then pass that variable into the ‘Options’ property of the Input Dialog activity.

NOTE: If you have a datatable you’re working with and not a datarow, then you have to specify a specific datarow. This can be done with an index (e.g. datatable(0) is first datarow of the datatable)

1 Like

YES, I’m using Datatable instead of DataRow

Here is a quick example of how to do it. Note I didn’t save anything to variable, just did it directly in the input dialog activity. I’d recommend saving it to a variable and passing that in for transparency though :slight_smile:

Hsendel.xaml (7.1 KB)

This is what I need but Data are stored in one Column instead of one Row

Here’s an Example:Example.xlsx (9.7 KB) VariableInputDialogue.xaml (6.0 KB)

Sorry about that, I misread the original question. This can be done with LINQ. The following query can be put into an assign activity and will return a string array:

Assign MyStringArray = (From row In dt1 Select Options = row("col1").ToString).ToArray()

You will need to update the row(“col1”) to be the name of the column you would like to choose. So if the column name is ‘Column A’ then you would change it to row(“Column A”). You can also choose it by index, so if you wanted the 3rd column then it would be changed to row(2)

Here is the updated example file: Hsendel.xaml (8.7 KB)

EDIT: I saw your post with the example file. I have edited it here so it is working as you’d like. Please see the annotations within to see what edits I have made. VariableInputDialogue-Dave_Edits.xaml (7.9 KB)


here you go
kindly try this and let know for any queries or clarification (22.6 KB)

kindly correct me if i m wrong with the question
Cheers @hsendel


Thanks Dave and Palaniyappan,

You have both provided correct solution with different ways, which one I put as “Solution” for this case ?

1 Like