Hyperlinks and Bookmarks

The Encodian population engine supports dynamic hyperlink and bookmark generation.

Insert a Hyperlink

Example Document: Encodian - Template Syntax - Links.docx

Example JSON Data:

{
"companyName": "Encodian",
"linkUrl": "https://www.encodian.com",
"linkDisplay": "Encodian Website"
}

The link token requires two parameters, the URL and display text, see below:

<<link[linkUrl][linkDisplay]>>

mceclip1.png

This generates the following output:

mceclip0.png

Insert a bookmark

Example Document: Encodian - Template Syntax - Bookmarks.docx

Example JSON data

{
    "bookmark_expression":  "Bookmark",
    "bookmarkDisplay":      "My Bookmark"
}

The bookmark token requires one parameter; the bookmark_expression.

<<bookmark [bookmark_expression]>>
I need to easily find this piece of text later
<</bookmark>>

This generates the following output

Bookmark2.png

The link token can be paired with the bookmark token to create a visible link in the document to the bookmark. It requires two parameters the bookmark expression (this links it with the bookmark token) and the display text:

<<link [bookmark_expression][bookmarkDisplay]>>

bookmark3.png

This generates the following output

bookmark4.png

Notes:

  • The words within the square brackets [] are just text and can be changed (provided your JSON is also changed) this will be required if you are going to create more than one bookmark within the same document. i.e instead of [bookmark_expression] you have [expression1], [expression2] etc

  • Everything from the opening bookmark tag to the closing bookmark tag must either be on the same line or only separated by line breaks (in most cases this will be shift+enter). Any paragraph breaks (enter) will cause the bookmark to not create as expected (it will not error). 
    The one on the left will work the one of the right will not (this markup can be seen by turning on paragraph marks in word)



    The above also applies to the link tag. Everything within the tag must either be on the same line or only separated by line breaks, 

 

 

 

 

 

 

Have more questions? Submit a request

14 Comments

  • 0
    Avatar
    Kurt Kamletz

    Thanks for your instructions, total life saver yesterday!

     

    Follow-up question. 

    The instruction above shows how to create a Hyperlink by passing in the URL and display text.

    Is there a way to pass in only the URL when the display text is static and already defined in the document?

  • 0
    Avatar
    Roy Simmons

    Hello Kurt,

    From what I tested you would use a combination with a Variable syntax to apply a static text with the URL and then you can simply pass the url in the json.
    The example below shows how it works and the result.

  • 0
    Avatar
    Luca Georg

    Hi everybody, i have a quastion. Is it also with more than one link possible? 

    For example:

    {
    "companyName1": "x",
    "linkUrl1": "x",
    "linkDisplay1": "x",
    "companyName2": "x",
    "linkUrl2": "x",
    "linkDisplay2": "x
    }
  • 0
    Avatar
    Roy Simmons

    HI Luca,

    The following Json example can put more then 1 link it would be written like the example below

    If you want to pass a Array of Url links you need to follow the foreach syntax which examples can be found in the article below.
    Repeating Content – Encodian Customer Help

  • 0
    Avatar
    Luca Georg

    Hi Roy,

    thank you for your fast response.

    So that is wrong??

     

  • 0
    Avatar
    Roy Simmons

    Hi Luca,

    No worries your Json is not correctly formatted as you are missing " Double quotes " in your reference you can check this only with a Json Formatter.
    This will cause a Error if you are encountering errors we recommend to Follow the article below and email support@encodian.com
    Power Automate Run History - Inputs and Outputs — Encodian

  • 0
    Avatar
    Luca Georg

    Hi Roy, thank you. It work!

  • 0
    Avatar
    Erin Mullns

    I am wondering if it is possible to put multiple bookmarks/hyperlinks within the template using the foreach array. See below

    bookmark/hyperlink (indication)

    • <<foreach [cc in coverage_criteria]>><<[cc.indication]>>

    <</foreach>>

    links to indication further down in the document

    <<[ccpa.indication]>><</foreach>>

  • 0
    Avatar
    Roy Simmons

    Hi Erin,

    You will need to follow the array data structre and Foreach Syntax in the article link below for foreach.
    https://support.encodian.com/hc/en-gb/articles/360020415778-Repeating-Content

    You can repeat multiple bookmarks/Hyperlins when you pass the array and it would look like the simple example below.
    Please note in your example you 1 starting foreach and 2 ending /foreach which is incorret.

    • <<foreach [cc in coverage_criteria]>><<link[cc.Linkhere][cc.indication]>><<bookmark [cc.bookmark_reference here]>>
      <</foreach>>
  • 0
    Avatar
    Yuvaraj

    Is it possible to have hyperlink which caters for blank URL as well? Link syntax is expecting URL value from the JSON. In my scenario, I will not always have URL value. Any workaround for this ?

  • 0
    Avatar
    Roy Simmons

    Hi Yuvaraj,

    For the Syntax it expecting a value as if there is no link then it just a simple text?
    You may need to wrap the syntax in a If Condition to either put a Hyperlink or normal text.
    https://support.encodian.com/hc/en-gb/articles/360020512538-Conditional-Expressions

    <<if [linkURL == ""]>>
       <<[linkDisplay]>>
    <<else>>
       <<link[linkURL][linkDisplay]>>
    <</if>>
  • 0
    Avatar
    Erin Mullns

    Hi Roy - 

    thanks for the information, I was able to successful add the hyperlink/bookmark into the document. However I am coming up with issues on character limit that is causing the link not to go to the bookmark in the document. The bookmark appears to not display the whole title of the indication. Is there any way to circumvent this? 

  • 0
    Avatar
    Erin Mullns

    Here is the example of the bookmarks:

  • 0
    Avatar
    Roy Simmons

    Hi Erin,
    I have replied to you in our troubleshooting post, if you like to continue the conversation please reply in the link below.
    https://support.encodian.com/hc/en-gb/community/posts/16773072109980-Populate-word-Possible-to-put-multiple-bookmarks-hyperlinks-within-the-template-using-the-foreach-array?page=1

Please sign in to leave a comment.
Powered by Zendesk