For Each, Array and Input Dialog

Hello!

I have three centers where you can view data with my bot, I need the user to be able to select a center using an input dialog and then have the selection used to hold an array that the bot will iterate through. The center name will hold an array of the employee names for that center. I then am using a for each to iterate through the names to collect the data. Can someone please show an example of successfully completing this or send me in the right direction? Thank you!

@Skyler_Blu

you have 3 centers will there be any data present in that?

if yes

then use for each activity and pass the output of inputdialog box

then iterate it

I tried this method and this is the error that occurs
Capture
.

@Skyler_Blu

can you send the value which you have passed in the for each activity

These are the values, but I believe I am doing it incorrectly. When the user selects a center, I need it to be updated for each center (variable of string containing names).
Capture.PNG5


Capture.PNG7

@Skyler_Blu

Userinput is a string variable i should not be passed in the for each activity

Yes, so how would I allow the user to choose a center and then have the bot iterate through the chosen center?

@Skyler_Blu

if the user selected option does not have values then flow this

if the input selected options having values then use for each

repeat the process for other 2 cases aslo

I’m trying this now! I will let you know if it works, thank you!

@Skyler_Blu

ok sure

Thank you

cheers

For some reason, nothing occurs after the input dialog is chosen. The bot just stops. Could you please look at this code and possibly fix my error or instruct me on my error?
Sequence1.xaml (35.8 KB)

@Skyler_Blu

its showing that document is invalid.

can you share the zip file of your xaml?

Sequence1.xaml (35.8 KB)
TestDoe.xlsx (15.6 KB)

I sent the file with test info inside, you should be able to use it to see if the bot will run.

@Skyler_Blu

share the file by making zip file

Sequence1.zip (23.0 KB)

@Skyler_Blu

replace the values in the input dialog box as “Brooklyn;PineBluff;ClarksDale”

image

bot will enter into the activities

place the build datatable outside of for each activity

cheers

Thanks! I am still receiving this error though.

@Skyler_Blu

Dont create a variable with Brrokyln just pass the name

delete the for each activity and place new for each and try it will work

cheers

Thank you so much it works!!

1 Like