Forum Discussion

HannahEngelson's avatar
HannahEngelson
Qrew Trainee
3 months ago

Check one field for multiple conditions

Hey there!

I am almost certain this has been asked before, but I have been searching for hours and can't find anything.

I am building an app that tracks flight delays and auto assigns a manager for follow up based on the departure airport. For example, I need the formula to populate Manager A if Departure Station is JFK, LGA, EWR, BWI, DCA, or IAD or to populate Manager B if Departure Station is DTW, ORD, MDW, MKE, or MSN. And down the line for all of our airports and managers.

I have something that is working during testing, in a formula-user field so it can be the basis of email notifications when they have been assigned a new delay. But we have hundreds of airports, so there has to be an easier way than a line item for each individual airport.

If(
[Departure Station]="JFK", ToUser("ManagerA@Company.com"), 
[Departure Station]="LGA", ToUser("ManagerA@Company.com"), 
[Departure Station]="DTW", ToUser("ManagerB@Company.com"),
[Departure Station]="ORD", ToUser("ManagerB@Company.com"))

Please help and let me know if you need more info! Thank you!

  • You should have a table where the key field is the airport code and another field for the Manager's Userrid.

    Then make a relationship between your flights table and your airports table and look up the manager down to Flights.  

  • You should have a table where the key field is the airport code and another field for the Manager's Userrid.

    Then make a relationship between your flights table and your airports table and look up the manager down to Flights.  

  • It's late in the day, so my brain has lost a couple cylinders, but I'm pretty sure this makes sense. The two tables will be connected based on airport code, and then the manager will be a lookup field based on that connection? Am I seeing that right in my brain?

    Thank you so much for your quick reply!