Skip to main content
Question

Contains -- Multiple options

  • March 29, 2020
  • 0 replies
  • 298 views

Hey,

Basically I have a bunch of locations and different jobs that I would like to be able to Populate the field with one outcome, and I am wondering if its possible to have something like

IF(Contains([LOCATION],"Milton","Oakville","Mississauga") AND ([WORKTYPE],"Spill","Containment"), "Emergency Response"

Or if I would have to list out all the possible combinations. Which would total about 100 different types. 

Thanks for any help

------------------------------
Matt Melrose
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+15
  • Registered
  • March 30, 2020
Matt,

You can build a statement

IF (  Contains([LOCATION],"Milton","Oakville","Mississauga") AND
        Contains ([WORKTYPE],"Spill","Containment"), "Emergency Response", 
        Next set of conditions, ....

Is there a deeper relationship you can build and exploit to get your result so that you do not have to create a massive If Statement?

I am assuming that your users type in a [LOCATION] from information about the customer so there is an unlimited amount of possible answers. If  "Spill" and "Containment"   are always going to be "Emergency Response"  then you could have the table where you need the information "Emergency Response"  inherit from the relationship.



In this example the user would be able to type "Milton" into the Work Order, then select "Spill" and it would automatically be an "Emergency Response"   I realize this does not exactly answer your question but I hope it sparks an idea on how to architect your application to get the answer you need.  


Reach out if you want to share more info on the app and look deeper at structure.
 






------------------------------
Don Larson
Paasporter
Westlake OH
------------------------------

AdamKeever1
Forum|alt.badge.img+2
  • Registered
  • March 30, 2020
The 'Contains' formula function requires a single variable text string and a text field to query, but you can use the Or function to query all of the combinations of your options.

Try this Matt:

IF(
Contains([LOCATION],"Milton")=true or Contains([LOCATION],"Oakville")=true or Contains([LOCATION],"Mississauga")=true
and Contains([WORKTYPE],"Spill")=true or Contains([WORKTYPE],"Containment")=true,
"Emergency Response",
"")

------------------------------
Adam Keever
------------------------------