Skip to main content

Notifications

Power Automate - Building Flows
Answered

Pre Built Expressions in HTML to auto populate with flow

Posted on by 60
Hi,
 
I have a flow that uses expressions to populate different parts of html dynamically.  What I am tring to do is have a bunch of HTML templates saved to a sharepoint doc library and the flow will get the file content of that html file and replace the expressions with what they are suppose to represent.
 
Example of what the contents of the HTML file in sharepoint looks like.
    <table>
        <tr>
            <th>Pour Date</th>
            <td colspan="3">@{body('Parse_JSON')?[0]['ResponseDate']}</td>
        </tr>
        <tr>
            <th>Pour Number</th>
            <td>@{body('Parse_JSON')?[1]['ResponseText']}</td>
            <th>Pour Name</th>
            <td>@{body('Parse_JSON')?[2]['ResponseText']}</td>
        </tr>
        <tr>
            <th>Engineer</th>
            <td colspan="3">@{body('Parse_JSON')?[3]['ResponseText']}</td>
        </tr>
        <tr>
            <th>Sub-Contractor</th>
            <td colspan="3">@{body('Parse_JSON')?[4]['ResponseText']}</td>
        </tr>
        <tr>
            <th>Concrete Supplier</th>
            <td>@{body('Parse_JSON')?[5]['ResponseText']}</td>
            <th>Contact at the plant</th>
            <td><job_workflow 1258183 value></td>
        </tr>
 
 
So I would like the flow to auto populate the parts in bold.
 
Flow works fine when I just paste the html into a compose action, but since I could have over 100 different HTML templates I thought I could read the contents of the template into flow and it would populate the same way.
  • Verified answer
    Chriddle Profile Picture
    Chriddle 7,077 on at
    Pre Built Expressions in HTML to auto populate with flow
    No, that doesn't work. You can't add (and execute) expressions at runtime.
     
    But you can do string replacements within the HTML templates like this:
    replace(
    	<your_HTML_template>,
    	'@{body(''Parse_JSON'')?[2][''ResponseText'']}',
    	body('Parse_JSON')?[2]['ResponseText']
    )
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,532

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,050

Leaderboard