cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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
Highlighted
Advocate II
Advocate II

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
Highlighted
Community Support
Community Support

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.
Highlighted
Advocate II
Advocate II

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.

Highlighted
Advocate II
Advocate II

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

Highlighted
Frequent Visitor

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
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (7,689)