web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sending an email with ...
Power Apps
Answered

Sending an email with if various statements

(0) ShareShare
ReportReport
Posted on by 270

Hey all,

 

I have the following on my OnSuccess:

 

Office365Outlook.SendEmailV2(Form1_9.LastSubmit.ApplicantName.Email, " Ref: " & DataCardValue77_1, "The Manager has sent you the outcome of the application Ref: " & DataCardValue77_1 

& 

If(DataCardValue70_1.Text = "Rejected" Or DataCardValue71_1.Text = "Rejected" Or DataCardValue72_1.Text = "Rejected" Or DataCardValue73_1.Text = "Rejected" Or DataCardValue74_1.Text = "Rejected" Or DataCardValue75_1.Text = "Rejected" Or DataCardValue76_1.Text = "Rejected" Or DataCardValue22.Text = "Rejected", "<br> Your application for " & vItem.RequestFor.Value & " has been <b>rejected.</b> <br> See response(s) for rejection:" )

&

If(DataCardValue70_1.Text = "Authorised" Or DataCardValue70_1.Text = "Conditional" Or DataCardValue70_1.Text = "N/A" And DataCardValue71_1.Text = "Authorised" Or DataCardValue71_1.Text = "Conditional" Or DataCardValue71_1.Text = "N/A" And DataCardValue72_1.Text = "Authorised" Or DataCardValue72_1.Text = "Conditional" Or DataCardValue72_1.Text = "N/A" And DataCardValue73_1.Text = "Authorised" Or DataCardValue73_1.Text = "Conditional" Or DataCardValue73_1.Text = "N/A" And DataCardValue74_1.Text = "Authorised" Or DataCardValue74_1.Text = "Conditional" Or DataCardValue74_1.Text = "N/A" And DataCardValue75_1.Text = "Authorised" Or DataCardValue75_1.Text = "Conditional" Or DataCardValue75_1.Text = "N/A" And DataCardValue76_1.Text = "Authorised" Or DataCardValue76_1.Text = "Conditional" Or DataCardValue76_1.Text = "N/A" And DataCardValue22.Text = "Authorised" Or DataCardValue22.Text = "Conditional" Or DataCardValue22.Text = "N/A", "<br> Your application for " & vItem.RequestFor.Value & " has been <b>authorised or Conditional.</b><br> See response(s) and any condition(s) if applicable:" )

&
" <br><br><b> BM - Outcome: </b> " & DataCardValue70_1.Text &
If(DataCardValue70_1.Text = "Rejected", "<br><b>The reason(s) the BM rejected this is:</b> <br>" & vItem.PartLRejection) & If(DataCardValue70_1.Text = "Conditional", "<br><b>The condition(s) the BM has authorised with is:</b> <br>" & vItem.PartLConditions) & 

etc etc.......

The problem is, if the Value in any of the 1st statement are 'rejected', the 2nd statement should not trigger - by default the application is rejected.

e.g. If any 1 of the 8 values are equal to rejected, only the first if statement should activate.

With the code I have written both the if statements are triggering.
In the test item, I have a couple of rejected values and a couple of authorised, the email being sent contains both the above values as both are 'true', I need help changing the code to allow only the rejected statement to be sent to the applicant if any 1 of the values are rejected, of course if any do not contain rejected the next If statement to kick in please

 

Thank you in advance.

 

Categories:
I have the same question (0)
  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi,

    Yous can try with Nested If, Hope that will help you to resolve your Issue.

    Like below,

    If(DataCardValue70_1.Text = "Rejected"
    Or DataCardValue71_1.Text = "Rejected"
    Or DataCardValue72_1.Text = "Rejected"
    Or DataCardValue73_1.Text = "Rejected"
    Or DataCardValue74_1.Text = "Rejected"
    Or DataCardValue75_1.Text = "Rejected"
    Or DataCardValue76_1.Text = "Rejected"
    Or DataCardValue22.Text = "Rejected",
    "<br> Your application for " & vItem.RequestFor.Value & " has been <b>rejected.</b> <br> See response(s) for rejection:",

    If(DataCardValue70_1.Text = "Authorised" Or
    DataCardValue70_1.Text = "Conditional" Or
    DataCardValue70_1.Text = "N/A"
    And DataCardValue71_1.Text = "Authorised"
    Or DataCardValue71_1.Text = "Conditional"
    Or DataCardValue71_1.Text = "N/A"
    And DataCardValue72_1.Text = "Authorised"
    Or DataCardValue72_1.Text = "Conditional"
    Or DataCardValue72_1.Text = "N/A"
    And DataCardValue73_1.Text = "Authorised"
    Or DataCardValue73_1.Text = "Conditional"
    Or DataCardValue73_1.Text = "N/A"
    And DataCardValue74_1.Text = "Authorised"
    Or DataCardValue74_1.Text = "Conditional"
    Or DataCardValue74_1.Text = "N/A"
    And DataCardValue75_1.Text = "Authorised"
    Or DataCardValue75_1.Text = "Conditional"
    Or DataCardValue75_1.Text = "N/A"
    And DataCardValue76_1.Text = "Authorised"
    Or DataCardValue76_1.Text = "Conditional"
    Or DataCardValue76_1.Text = "N/A"
    And DataCardValue22.Text = "Authorised"
    Or DataCardValue22.Text = "Conditional"
    Or DataCardValue22.Text = "N/A",
    "<br> Your application for " & vItem.RequestFor.Value & " has been <b>authorised or Conditional.</b><br> See response(s) and any condition(s) if applicable:" ),etc

    )

  • PowerAGuy Profile Picture
    270 on at

    @VijayTailor 

    I've had another bash and I can see where I made the error, I will test further but think this is working

    Thanks, will confirm and mark your suggestion as an answer later

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 150 Super User 2026 Season 2

Last 30 days Overall leaderboard