cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nana001
Advocate I
Advocate I

Edit HTML file created from converted email

I have the below flow that takes an email from the trigger When a new mail arrives v3. It exports to EML format, then to HTML format. However, the HTML conversion from the EML exported uses UTC time zone rather than my local time zone. I dont see any option to change the time zone so that the exported HTML file has the correct local time. If there is such an option, please let me know 😞

 

I am therefore trying to edit the exported HTML file to replace the following text in the exported HTML file with the correct local time, which is "Converted time" in the below flow. The relevant part of the exported HTML file:

<tr style="height:18px; vertical-align:top">
<td style="font-weight:bold; white-space:nowrap">Sent on:</td>
<td>Tuesday, March 21, 2018 11:18:10 PM<br>
</td>

 

In the above example, I would like to replace the text "Tuesday, March 21, 2018 11:18:10 PM" with the string from "Converted time". Is there a way to edit the HTML file to replace this text? Of particular importance, I would like it to only replace the first instance where "Sent on:</td><td>" appears as it may be an email chain with two or more such entries.

 

Please help 🙂

 

FLOW Post.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
nana001
Advocate I
Advocate I

I have figured out that I can use the return of the Convert File action as a string, which is returned as an HTML string if the convert action is to HTML. I have also figured out how to replace the date/time with correct date time. However, I also want to insert a link to each of the email attachments on the email received - I have figured this out. The link that is inserted into my HTML will not work when I load the email converted to HTML - it will give me one of a few errors including:

Network Error

"The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle."

 

It is strange that when I press refresh it will also not load the link (permanent link to the Document ID). However, if I copy and paste the same URL to a new tab it will load the email attachment correctly. Any idea what the problem is?

 

The hyperlink I insert into the converted HTML:

<a href="**Sharepoint site**/_layouts/15/DocIdRedir.aspx?**Document ID**" target="_blank">Email Attachment Name</a>

View solution in original post

3 REPLIES 3
nana001
Advocate I
Advocate I

I have figured out that I can use the return of the Convert File action as a string, which is returned as an HTML string if the convert action is to HTML. I have also figured out how to replace the date/time with correct date time. However, I also want to insert a link to each of the email attachments on the email received - I have figured this out. The link that is inserted into my HTML will not work when I load the email converted to HTML - it will give me one of a few errors including:

Network Error

"The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle."

 

It is strange that when I press refresh it will also not load the link (permanent link to the Document ID). However, if I copy and paste the same URL to a new tab it will load the email attachment correctly. Any idea what the problem is?

 

The hyperlink I insert into the converted HTML:

<a href="**Sharepoint site**/_layouts/15/DocIdRedir.aspx?**Document ID**" target="_blank">Email Attachment Name</a>

v-litu-msft
Community Support
Community Support

Hi @nana001,

 

I am glad your issue has been solved by yourself.
If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

Best Regards,
Community Support Team _ Lin Tu

Hi nana001.

 

Jumping in on an old thread but hoping you might be able to help me out! I'm a newbie to Power Automate.

I am trying to add a paginated Power BI report to the body of an email.

 

Could you please provide more details the steps you took to get to your resolution:

"I have figured out that I can use the return of the Convert File action as a string, which is returned as an HTML string if the convert action is to HTML. I have also figured out how to replace the date/time with correct date time."

 

I am using a similar method to what you describe, but I can't seem to figure out how to do the replace within the html file.

 

Cheers.

Niall.

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,907)