Mar 24, 2022 02:10 PM
I have 3 “Yes or No” single select fields and 3 email fields. If the answer is yes I want the corresponding email to be added and a comma to separate the emails. I can’t seem to figure the correct formula out:
Review 1 (Single Select Field) (Yes or No)
Review 2 (Single Select Field)(Yes or No)
Review 3 (Single Select Field)(Yes or No)
Email 1 (Lookup Field) (test1@test.com)
Email 2 (Lookup Field) (test2@test.com)
Email 3 (Lookup Field) (test3@test.com)
If Review 1 is YES add Email1 and a comma (if NO add nothing)
and
If Review 2 is YES add Email2 and a comma (if NO add nothing)
and
If Review 3 is YES add Email3 (if NO add nothing but would not want the comma from previous YES)
Any help would be appreciated!
Mar 24, 2022 07:32 PM
You are correct that it works with the comma on the end. I did try the ; instead of the comma but the email automation in AT would not work unless it was a comma with no spaces.
Mar 24, 2022 08:01 PM
Ah ha, this is the issue. If you do not want the space, you also have to remove the space from the REGEX_REPLACE
as well. Thank you for the screen captures. It made it much easier to diagnose the problem.
REGEX_REPLACE(
CONCATENATE(
IF({CCO to Review}= “YES”, {CCO Email} & ","),
IF({Designee to Review}= “YES”, {Approver Email} & ","),
IF({Alternate to Review}= “YES”, {Alternate Email})
),
",$",
""
)
Mar 24, 2022 08:16 PM
Amazing! Thank you so much for all your help!