Return mail adress on two conditon (search in enumlist)

Trying to write an expression for a  To section in a "send an email" task for the "ORDERS" table, to send an email to the "PROJECT MANAGER" when new orders are added.

I can get the mail address of the project manager with the expression below.

 

ANY(SELECT(STAFF[E-MAIL],[POST] = "PROJECT MANAGER")

 

 

I want to add also a condition because I don't want to send an email to all project managers.

In my "STAFF" table, I have a enumlist type column called [PROJECT]. 
In the "ORDERS" table [SITE]  column comprise the values of [PROJECT].

How to make an expression to get the mail address of the project manager from the "STAFF" table who is appointed the [SITE], in the "ORDERS" table.

I also tried to combine two expression below but I did't make it combined. 

 

ANY(SELECT(STAFF[E-MAIL],[POST] = "PROJECT MANAGER")
IN([SITE],
SPLIT(LOOKUP(USEREMAIL(),โ€œSTAFFโ€,โ€œE-MAILโ€,โ€œPROJECTSโ€)," , "))

 

 

Thank you for your time in reading this issue.

 

Solved Solved
0 2 79
1 ACCEPTED SOLUTION

Try

SELECT(
 STAFF[E-MAIL],
 AND(
  [POST] = "PROJECT MANAGER",
  IN(
   [_THISROW].[SITE],
   [PROJECTS]
  )
 )
)

View solution in original post

2 REPLIES 2

Try

SELECT(
 STAFF[E-MAIL],
 AND(
  [POST] = "PROJECT MANAGER",
  IN(
   [_THISROW].[SITE],
   [PROJECTS]
  )
 )
)

God bless you sir!
Thank you so much!

Top Labels in this Space