cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Trumpetritz
Level: Powered On

Conditions within "Send E-Mail - To" field

Hi,

 

does anyone have an idea how to work with conditions within the "To" field? I want to send out a notification email based on three field value in my Sharepoint list.

 

Basically the logic should be: "If Checkbox is true and Listbox.Value = "value1" then send Email to approver"

 

I already created a condition statement but Flow says it's not correct:

 

if(and(equals(['LeadApproval'], TRUE),not(equals(['Status_x0020_Approver']?['Value'], 'approved'))),'Approver_x0020_Name']?['Email'])

 

Field names are: LeadApproval (Checkbox), 'Status Approver' (Listbox), 'Approver Name' (User Name Email)

 

Thanks and kind regards!

 

Jan

1 ACCEPTED SOLUTION

Accepted Solutions
Trumpetritz
Level: Powered On

Re: Conditions within "Send E-Mail - To" field

Solved by setting up four different flows instead of on conditional selection

View solution in original post

4 REPLIES 4
Community Support Team
Community Support Team

Re: Conditions within "Send E-Mail - To" field

Hi @Trumpetritz,

 

Could you show a bit more about error message of your condition statement?

Further, could you please share a screenshot of your flow’s configuration?

I think there is an error of usage of function in your condition statement. The if() function require three parameters as input parameters, but you provide two parameters.

 

I have made a test on my side and the flow works well. Please take a try with the following workaround:

  1. Add a proper trigger, here I use Flow button trigger.
  2. Add “Get items” action
  3. Add a “Apply to each”, use output of “Get items” action as input parameter
  4. Within “Apply to each”, add “Send an email” action, “To” Set to the following formula:
if(and(equals(item()?['LeadApproval'],false),not(equals(item()?['Status_x0020_Approver'],'Approved'))),item()?['Approver_X0020_Name']?['Email'],'xxxx@xxxxxxx.com')

Note: The red mark part in above formula is the third parameter.

Image reference:2.PNG

 

5.jpg

 The flow works successfully as below:6.jpg

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Trumpetritz
Level: Powered On

Re: Conditions within "Send E-Mail - To" field

Thank you! The IF-Statement with item() has been accedpted, but I don't understand the background for "Apply to each".

 

Let me explain the purpose with screenshots straight away from the input form.

 

1. If changes within the entry have been applied, send an email to the named approver in case he/she has been marked and has not been approved so far.

 

Input.PNG

 

2. The  IF-Statement examples (Operational and Strategic Pricing) look as follows and cover the above logic:

 

if(and(equals(item()?['opPricingApproval'], TRUE),not(equals(item()?['Status_x0020_op_x0020_Pricing']?['Value'], 'genehmigt'))),item()?['op_x0020_Princing_x0020_Name']?['Email'],'')

 

if(and(equals(item()?['stratPricingApproval'], TRUE),not(equals(item()?['Status_x0020_strat_x0020_Pricing']?['Value'], 'genehmigt'))),item()?['strat_x0020_Princing_x0020_Name']?['Email'],'')

 

3. After inserting them into the formula, I get to following picture:

 

Header.PNG

 

4. The trigger runs and the process shows success but only emails to "Antragsteller" and "RCM..." have been sent out. No Emails out of the IF Statments. The process documentation provides the following information:

 

Output.PNG

 

THANK you for having a look.

Trumpetritz
Level: Powered On

Re: Conditions within "Send E-Mail - To" field

Solved by setting up four different flows instead of on conditional selection

View solution in original post

Azlin
Level: Powered On

Re: Conditions within "Send E-Mail - To" field

Hello @Trumpetritz 

 

Could you please teach me on how you did this?

I'm having a similar issue where I only want to send out email notification based on the three condition in my flow.

You may check on my post below

https://powerusers.microsoft.com/t5/Building-Flows/How-to-sent-email-notification-that-based-on-the-...

 

Thank you,

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,845)