cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

If within Patch and Send email

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..

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: If within Patch and Send email

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.

View solution in original post

4 REPLIES 4
Highlighted
Community Champion
Community Champion

Re: If within Patch and Send email

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.

View solution in original post

Highlighted
Community Support
Community Support

Re: If within Patch and Send email

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-outloo...

 

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

 

Best regards,

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
Frequent Visitor

Re: If within Patch and Send email

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.", 

 

Highlighted
Community Champion
Community Champion

Re: If within Patch and Send email

No problems @MJ_RT ,

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (14,717)