cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

get the html file from SP Asset library in power automate


Hi all,


I am new to power automation. I have created the HTML table using create HTML table and Compose action in power automate. here we need to use the HTML table which is created in SP asset library. is there any way to call a html file in power automate?

is there any way to write html in power automate ?

1) power automate component with following html code.

<table style="width:100%">
<tr>
<th>names</th>
</tr>

2) get items , loop append to table row.

<tr>
<td>current item 1</td>

</tr>

<tr>
<td>current item 2</td>

</tr> ... etc

3) close the table and send email.

</table>

 

is it possible ?

1 ACCEPTED SOLUTION

Accepted Solutions

@Anonymous 

 

Hey Mate,

 

Here you go

 

HTML in SharePoint Library. Note: I have $$$$$ which I will replace with actual table in Power Automate.

 

<html>
<head>
<style>
table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</head>
<body>

<h2>HTML Table</h2>

<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>

  $$$$$

</table>

</body>
</html>

 

Flow Solution.

CFernandes_0-1602747184914.png

 

Formula to replace $$$$$ with HTML 

 

replace(outputs('Compose'),'$$$$$',variables('strVar'))

 

Note: strVar hold the Table we created dynamically.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

View solution in original post

9 REPLIES 9
CFernandes
Super User
Super User

Hey Mate,

 

@Anonymous 

 

This is my solution

 

CFernandes_0-1602608214633.png

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

 

Anonymous
Not applicable

Hi @CFernandes 

 

Thanks for your quick response. I need to call that html file, then create the table in Power automate . Is it possible?

 

Thanks a lot.

@Anonymous  Can you please help me with a sample?

Anonymous
Not applicable

Hi ,

 

Consider a file stored in SP asset library. below is the file content.( file may contain the html or css )

 

<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>
    <th>Age</th>
  </tr>
  <tr>

/* table row will be dynamically populated from power automate*/
  </tr>
</table>

I need to call this file in Power automate. then append the table rows (dynamic data from get list items).

 

@Anonymous You can create a Table using Append string and pass it to the HTML. 

 

  • The idea here would be to add a unique string in HTML.
  • Use the replace() function in HTML and replace the unique string with the Table that we populate in PowerAutomate.

It would be difficult for me to setup a sample for you as I am swamped with work today. Maybe I create a demo by tomarrow evening. 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Anonymous
Not applicable

Hi @CFernandes 

 

Thanks a lot .Please give some example . I will try from myside also.

 

Again thanks.

@Anonymous 

 

Hey Mate,

 

Here you go

 

HTML in SharePoint Library. Note: I have $$$$$ which I will replace with actual table in Power Automate.

 

<html>
<head>
<style>
table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</head>
<body>

<h2>HTML Table</h2>

<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>

  $$$$$

</table>

</body>
</html>

 

Flow Solution.

CFernandes_0-1602747184914.png

 

Formula to replace $$$$$ with HTML 

 

replace(outputs('Compose'),'$$$$$',variables('strVar'))

 

Note: strVar hold the Table we created dynamically.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

Anonymous
Not applicable

Hi @CFernandes 

 

Thanks for the sample .It worked perfectly.

 

Thanks a lot.

@Anonymous  Cheers Mate. I am glad that my solution helped.

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.

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,723)