cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ErikHeredia1
New Member

How to format datatable retrieved from Excel?

Hello,

 

I have set up a flow that allows me to automatically send an email if it doesn't already exist, and if it does exist, it just responds to it.

 

The problem I have is that the information that I am providing as a response is just a copy/paste of Excel tables and pivot tables. Unfortunately looking through the available flows, I can't seem to find a way to store the below data exactly as-is into a variable. The closest I have gotten was using "Read From Excel Worksheet" which does grab the information but none of it contains its original formatting.

 

 

 

Capture.PNG

3 REPLIES 3
Henrik_M
Super User
Super User

I very much doubt that you can store the information in a variable.

One thing you can try is to loop through the datatable in order to build an html structure similar to the Excel formatting.

Another thing you can try is to copy from Excel, and then through the Outlook interface paste the copied cells.

ErikHeredia1
New Member

That's unfortunate.

I was hoping to try to create a loop so all this was sent out on an hourly basis, and it seemed like the Outlook flows would have made that very easy to do.

Would you happen to have a resource on how to build HTML structures for the data table?

Hi @ErikHeredia1 

 

For building html table you can go by two options.

 

1. Find out the corresponding html code for the Excel table and then modify/use that in the "Send email through Outlook" by enabling the "Body is Html" option

 

This link will help you to get the html of the sheet.

ExtendOffice - How to convert Excel sheet or cells to html table?

 

2. If you think that gets too complex then simply take a basic html structure of any table and then add data from the PAD loop accordingly.

 

VJR_0-1647659227570.png

 

th: Table Header

tr: Table Row

td: Table Data

 

So take the above html and inside the PAD loop keep on adding data.

 

Examples:

<th>%ColumnHeader1%</th>

<tr>
<td>%LoopValue1%</td>
</tr>

 

Need to use string double quotes wherever applicable.

Once the loop ends the table will be automatically generated and then pass that string variable into the Outlook action.

 

This link will get you to know the structure of different html tables.

HTML Tables (w3schools.com)

 

One post slightly to understand this is here.

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.

Top Kudoed Authors
Users online (2,613)