cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AJ_vizMan
Helper V
Helper V

Using Expression for BBC field in outlook email to send email to multiple people on basis of Task Category

Hello,

I am using power automate connected with power apps so that whenever an action has been taken on certain category ticket, an outlook email is sent to requester keeping admin team in BCC.

i am using below expression for BCC field- 

 

if(equals(items('Apply_to_each')?['Category']?['Value'], or('Position Creation','Hiring','Termination','Restructure','Personal Information','Employment Information','Global Assignment'),concat('justin@abc.com','pia@abc.com','allison@abc.com,maria@abc.com,ruel@abc.com,earl@abc.com,Ajay.l@abc,siddharth@abc.com, ';'),'Aj@abc.com')

 

#Power Automate # Expressions

 

When i use this expression then it say 'Invalid'. There is something wrong but, i am unable to figure it out.

Could please help how i can mention multiple categories and how effectively can maintain multiple email addresses in expression.

1 ACCEPTED SOLUTION

Accepted Solutions

The use of ?['Value'] would be for a dropdown column.  for a single line of text it should just be 'Apply_to_each')?['SubCategory']



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

I think the problem is the way you are setting up the equals().  You can't use the or() function to add multiple values to be considered.  You need to do something more like this where each potential value has its own equals()

if(or(

equals(items('Apply_to_each')?['Category']?['Value'], 'Position Creation'),

equals(items('Apply_to_each')?['Category']?['Value'], 'Hiring'),

equals(items('Apply_to_each')?['Category']?['Value'], 'Termination),

equals(items('Apply_to_each')?['Category']?['Value'], 'Restructure'),

equals(items('Apply_to_each')?['Category']?['Value'], 'Personal Information'),

equals(items('Apply_to_each')?['Category']?['Value'], 'Employment Information'),

equals(items('Apply_to_each')?['Category']?['Value'], 'Global Assignment'))

,concat('justin@abc.com','pia@abc.com','allison@abc.com,maria@abc.com,ruel@abc.com,earl@abc.com,Ajay.l@abc,siddharth@abc.com, ';'),'Aj@abc.com')



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Hi @Pstork1 - Thank you for response. I am still struggling with above above expression.

Earlier i posted that need to use 'Category' column in expression but, i need to use 'Sub Category' column in the expression instead.

 

I tried 2 things -

1. Used the equals expression as suggested and concatenated the email addresses. But, it's throwing an error

 

AJ_vizMan_0-1623070587836.png

It says 'Selection is not supported on values of type 'string'.

 

2. Tried to initialize a variable of string type to hold email addresses but, it again results in error indicating

 'Selection is not supported on values of type 'string'.

I think 'Sub Category' column type seems to be creating an issue. Any advice how we can deal with it.

Thank you for your great support.

 

 

Is it due to column type difference? 

Have used 2 columns here 1. Sub Category - It is 'Single line of text' type column

2. 

The use of ?['Value'] would be for a dropdown column.  for a single line of text it should just be 'Apply_to_each')?['SubCategory']



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365 and PWR EduCon in Chicago
EduCon Chicago 2022

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (3,364)