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 / If within Patch and Se...
Power Apps
Answered

If within Patch and Send email

(0) ShareShare
ReportReport
Posted on by 69

Hello All,

I am still building my first app, and since I have no knowledge about power flow i am hard-coding in power apps to the best of my knowledge.

The scenario is about a check list of complete documentation for purchasing process.

 

User intimates requestor if submitted documents are complete or not, and if not, There are 2 types missing documents and wrong documents. for that I have check boxes.

 

CheckMissing

CheckMissing1 CheckMissing2 CheckMissing3

CheckWrong

CheckWrong1 CheckWrong2 CheckWrong3

 

I wrote the code to patch into excel, now i am trying to send an email to the requestor to tell what documents are missing and what are wrong.

 

If(notcomplete.Value=false,

Office365Outlook.SendEmail(lstSalesMA.Selected.Mail,"Documents Received " &
"Hallo; <br> <br>
We have received the application."
, {IsHtml: true}
),

 

// Now I am stuck here if notcomplete.Value=True

 

Office365Outlook.SendEmail(lstSalesMA.Selected.Mail,"The request is incomplete " &
"Hallo, <br> <br>
There are missing and wrong documents in your application.<br>"&
"Missing Documents<br>"&
If(CheckMissing1.Value=true, If(CheckMissing2.Value=true,); .... etc

// checkbox labels need to be listed part of the body

 

"Wrong Documents<br>"&

If(CheckWrong1.Value=true, If(CheckWrong2.Value=true,); ... etc

// checkbox labels need to be listed part of the body

 

)
,{IsHtml: true}

)
)

 

Hope this clarifies.

Cheers..

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    Hi @MJ_RT ,

    Something like this?

    If(
     notcomplete.Value=false,
     Office365Outlook.SendEmailV2(
     lstSalesMA.Selected.Mail, //note correction - Subject line
     "Documents Received ",
     "Hallo; <br> <br> We have received the application."
     ),
     Office365Outlook.SendEmailV2(
     lstSalesMA.Selected.Mail,
     "The request is incomplete ", //note correction - Subject line
     "Hallo, <br> <br> There are missing and wrong documents in your application.<br>" &
     "Missing Documents<br>" &
     If(
     CheckMissing1.Value=true,
     YourMissingDocuments1 & "<br>"
     ) & 	 
     If(
     CheckMissing2.Value=true,
     YourMissingDocuments2 & "<br>"
     ) & 
     "Wrong Documents<br>"&
     If(
     CheckWrong1.Value=true,
     YourWrongDocuments2 & "<br>"
     ) & 	 
     If(
    	 CheckWrong2.Value=true,
    	 YourWrongDocuments2 & "<br>"
     ) 
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @MJ_RT ,

    Based on the formula that you mentioned, I agree with @WarrenBelz 's thought almost. You have missed "Subject" line in your two Office365Outlook.SendEmail() function.

     

    The standard format of Office365Outlook.SendEmail() function as below:

    Office365Outlook.SendEmail(
     "Send Email To", // Type email addres here
     "Subject Line", // <---- do not miss argument here
     "Email body",
     {
     IsHtml: true
     }
    )

    Please check the following article about the usage of Office365Outlook.SendEmail() function:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-outlook#send-a-message

     

    Please try the solution @WarrenBelz provided above, then check if the issue is solved.

     

    Best regards,

  • MJ_RT Profile Picture
    69 on at

    Hi @WarrenBelz ,

    You are truly a champion. thanks for the solution.

    There was one extra comma at the end of below line which I had to remove.

     "Hallo; <br> <br> We have received the application.", 

     

  • WarrenBelz Profile Picture
    156,576 Most Valuable Professional on at

    No problems @MJ_RT ,

    Dangers of free-typing - I will fix it on the original so not to confuse others.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard