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

nialls
Frequent Visitor

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,600)