Inserting HTML

The Encodian population engine enables HTML to be inserted directly into the word document by using an expression format property. For further details on expression formatting please visit: Expression Results and Formatting

Expression Format

To insert HTML data directly into a document the HTML switch should be provided:

<<[token] -html>>

If the HTML switch is not present, the result of the expression is written to the document as plain text. Text formatting is derived from the first character of the corresponding token in this case.

If the HTML switch is present, the expression result is inserted into the document as an HTML block.

Example - Insert HTML

Example Document: Encodian - Template Syntax - Format HTML.docx

Example JSON Data:

{
"companyName": "Encodian",
"formedOn": "17/06/2008",
"overview": "We are <b>experts</b> in information, document and records management, we specialise in delivering business solutions for our customers utilising <i>Microsoft 365</i> and supporting Microsoft cloud technology."
}

Configure the required token within the document with the HTML switch:

<<[overview] -html>>

mceclip1.png

This generates the following output:

mceclip2.png

 

Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Engineering Projects

    Hello, I tried to follow your instructions to add HTML with data64 img:

    Here is the code for BackgroundHTML:

    <p>Test Background<br><img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxIQEhASEBAPFRAQFRAQDw8QEA8QEA8VFRUWFhUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OFxAQFy0dFR0tKysrLSsrKy0tLS0tLSstKy0tLS0tLS03Ky03LSs3LSsrLSsrLSs3KysrLSsrKysrK//AABEIAMMBAgMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAABAAIDBAUGB//EADUQAAIBAgUCBQQBAwIHAAAAAAABAgMRBAUSITFBUQYTImFxMoGRsUJSocFishQVI1Nyc+H/xAAZAQADAQEBAAAAAAAAAAAAAAAAAQIDBAX/xAAfEQEBAAICAwEBAQAAAAAAAAAAAQIREjEDITJBQhP/2gAMAwEAAhEDEQA/AM2+y+ENjRi36kOjwvhBPKy7r0cPmLEaMUtkiGsrcEsXdDZISkGoGoD2AEOJLgTFATQzJMcmNChaBsiGp+nclkMkhwkkZjrkdMs0cO3fokr3fAFUaI6lW1+NuVyzWp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/sQhHQ4H/9k=" /></p>

    Here is the outcome:

    I have tried to add CSS code but none of them works, unless i go to the .docx and change the photo wrap to SQUARE. but this is not practical as i am trying to work with Power Automate only.

    If I remove the img and keep only the words, it will display correctly.

    Please help.

  • 0
    Avatar
    Jo Hall

    Hi,

    I cannot exactly replicate what is causing your issue but believe the solution lies in the table/template formatting.

    If I take your HTML and put it straight into a newly created table I get the following result. 

    Here is my template  - Everything is put directly into the cells of the table the only manipulation I did was to merge the cells on the second row so it looked like your example. 

    As you mention photowrap, have you placed the <<[BackgroundHTML] -html>> within a text box within the cell? This did successfully work for me (again without touching the defaults).

    Edited by Jo Hall
Please sign in to leave a comment.
Powered by Zendesk