cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jharville
Helper V
Helper V

Convert HTML for 'Join - Teams Meeting' (in Outlook email body) into proper format

 

Hello all,

 

I have a screen on my PowerApp that uses the OnVisible of a confirmation screen to update the Subject, Body, and other sections of an Outlook meeting. In the 'Body' portion of the code, I want say where the room has been moved to .. which is the following code:

 

"Room has been updated to " & RoomsGallery.Selected.Name

 

 

As well as (on a different line) the Body of the previous meeting in Outlook; which is the following code:

 

 

MeetingsGallery.Selected.Body

 

 

My code doesn't contain any errors and successfully patches information to the Body of the Outlook meeting, but the issue is that for the 'MeetingsGallery.Selected.Body' portion of code, it's all in HTML.

 

jharville_1-1630515276162.png

 

This is what the Body of my existing Outlook email looked like before the Patch (and how I want it to look like):

 

jharville_2-1630515448242.png

 

And this is what the Body of my meeting looks like after the Patch (my code in the app) has run:

 

jharville_3-1630515528707.png

^^ and if you scroll into the HTML, you'll see the Teams Meeting - Join link is embedded deep within it:

 

jharville_4-1630515626551.png

 

Does anybody know how I'd be able to convert the HTML that is generated from my 'MeetingsGallery.Selected.Body' code back into the format that it's supposed to be in?

 

Thank you!

7 REPLIES 7
max81
Impactful Individual
Impactful Individual

@jharville : how do you send the email? via the Office 365 Outlook connector?

What formula do you use to send the mail? Office365Outook.sendMailV2()?

@max81 

 

Hi Max! Here is a screenshot of my code used in Outlook for the Body portion of code:

 

jharville_0-1630523186354.png

 

max81
Impactful Individual
Impactful Individual

@jharville  : according to the documentation, this action is deprecated.

Use this one: V4CalendarPatchItem

 

Additional: I just read that this action uses the Graph API. Checking out the result from the Graph API, I think you must use this for your body:

 

body:

{
"contentType": "html",
"content": "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><meta content=\"text/html; charset=us-ascii\"></head><body>New Product Regulations Strategy Online Touchpoint Meeting<div id=\"a59ada49-a492-4f1d-ac57-74be3a4194fc\" style=\"display:inline-block\"><table cellspacing=\"0\" style=\"table-layout:fixed; width:50px; border:0 none black\"><tbody><tr><td style=\"height:18px; padding:0; border-width:0 0 1px 0; border-style:none none solid none; border-color:#EAEAEA\">&nbsp;</td></tr></tbody></table><table cellspacing=\"0\" style=\"table-layout:fixed; width:90%; line-height:17px; border:0 none black\"><tbody>[...]</table></div></body></html>"
}

 

 

Hi @max81 ,

 

I don't have much experience with Graph API's, would I need to use a connector for it? 


I also changed my Office365Outlook.V2CalendarPatchItem() to Office365Outlook.V4CalendarPatchItem(), and added your code within the curly brackets {} to replace my code for the Body portion, and it errored out a lot. Would you be able to let me know what I'm doing wrong?

 

jharville_0-1630603312795.png

 

 

Thank you!

max81
Impactful Individual
Impactful Individual

The Graph API is used in the background of the Office 365 Outlook connector. So You don't have to to this 😉

 

 

I tried it out by myself and it must look like this:

 

Office365Outlook.V4CalendarPatchItem(
ComboBox1.Selected.id,
Gallery1.Selected.id,
Gallery1.Selected.subject,
Gallery1.Selected.start,
Gallery1.Selected.end,
Gallery1.Selected.timeZone,
{
body: "This is a <p style='color:black'>html</p> text"
}
)

 

 

 

 

This worked fine for me. So maybe your html-body is just not  correct.

@max81 

 

I replaced my entire Office365Outlook.V2CalendarPatchItem() code with the Office365Outlook.V4CalendarPatchItem() code you attached, and it errored out completely.

 

jharville_0-1630702154823.png

 

This was my previous Office365Outlook.V2CalendarPatchItem() code:

 

jharville_1-1630702180558.png

 

In my code, you can see in the blue-highlighted sections that those are the 6 fields that need to be edited with new information. In my code, it worked (and there were no errors) but it put HTML in the Body when I wanted it to look like this:

jharville_2-1630702502443.png

 

 

Where in your code would I implement those 6 patches for those fields? And how would I adjust your code to match my format? 

 

I appreciate your help, thank you so much.

max81
Impactful Individual
Impactful Individual

Just check your html. I think there must be some errors inside.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,535)