Data Management Practice 4 - Trouble with Input Dialog box

In the input dialog box I’m using the multiple choice option to get a list of cities to choose from. These cities are stored as keys in a dictionary, with their values being a double that is returned once a city is chosen.

Under the Input Options section I have Cities.Keys.ToArray which is exactly the same as in the solution workflow for this problem. However I’m getting the error “Argument ‘OptionsString’: compiler error(s) encountered processing expression “Cities.Keys.ToArray”. Value of type ‘1-dimensional array of String’ cannot be converted to ‘String’.”

I understand that the Input Options box wants me to list strings delimited with ;, but I’m confused as to why I can’t input a string array like the solution does.

Any idea what I’m doing wrong?

Hey the input dialog box option items should be in a string data type and not array. Join the array to a string with the function String.Join(",",CityArray)

This got it working! I put String.Join(",", Cities.Keys) so that it would list all of the keys, and then you could type which one you wanted.

Thanks Sarath!

1 Like

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