Passing Multiple String Parameters

643
2
12-02-2013 12:45 PM
NumaGremling
New Contributor
Hi everyone,

I wrote a script that  behaves differently based upon the keywords a user enters.

As of now it is still hardcoded; for example:
searchOrder.setKeywords(['hello'])


would search all results that contain the word ???hello???, and this:

searchOrder.setKeywords(['hello', 'forum'])


would search all results that contain the word ???hello??? and ???forum???.

Now, I would like to convert this script to a tool. But I am unsure how to obtain that list of keywords from users. I was thinking that I should be able to let the user type in a word, then click an Add button (the black cross, as seen in many tools), but I am unsure how to do that. When I set string to multivalue the resulting interface remains un-clickable:

[ATTACH=CONFIG]29508[/ATTACH]

Please let me know if you have any suggestions or think of a different approach.

Thank you.
Tags (2)
0 Kudos
2 Replies
TimDonoyou
Occasional Contributor
Hi there,

Two possible suggestions:

If you know all the keywords that the user is likely to input then you can set Filter parameter to Value List which will then allow you to enter all the possible options and when the tool is run they are a tick list.

The other possibility is using a RecordSet variable with a very simple single field table as the schema...

http://resources.arcgis.com/en/help/main/10.2/index.html#//002w00000023000000

hope this helps - let us know if you need anything else

Cheers

Tim
0 Kudos
DouglasSands
Occasional Contributor II
An additional possibility might be to simply have the parameter be a string and have the user enter a list of values on their own, which you could then convert in the script to a list. A user could enter:

'Home, field, space, list'

Which you could pass to:
' '.join(userString.split(',')).split()


The above code would work whether the user entered a list separated by commas or one with just spaces separating values.
0 Kudos