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

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
Pstork1
Dual Super User III
Dual Super User III

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.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

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.

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. 

Pstork1
Dual Super User III
Dual Super User III

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.

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (977)