For the most part, if you need help with Python, just Google for "python" and your subject. It usually doesn't matter if Select uses IronPython since it is based on Python. These examples should help. All we are doing is breaking the list into separate items and comparing it against the project text.
Code: Select all
project = Order.Project
# Items to look for in Project text.
target_list = ['X', 'Y', 'Z']
for item in target_list:
if item in project:
return True
# Not found.
return False
Since Python comparisons are always case sensitive, the matching will fail if the user enters lower case letters (i.e. 'x'). If you want to make it case insensitive, do comparisons after all the strings are made lower case. Of course, you can convert all to upper case for comparison since it doesn't matter what you convert to as long as it is the same.
Code: Select all
# Get the project and convert it to lower case for comparison.
project = Order.Project
project = project.lower()
# Items to look for in Project text. Enter words in lower case!
target_list = ['hello', goodbye', 'lawyer']
for item in target_list:
if item in project:
return True
# Not found.
return False