cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
saturation
Resolver I
Resolver I

Create HTML Table - insert <a> tags are displaying HTML rather than the link

I have an action Create HTML Table that is looping through data in a Apply to Each loop. I am unable to add hyperlinks as a string from my array, i.e., <a href=zzzzzz>zzz</a> without it displaying the literal URL rather than as a hyperlink. Is there a way to have the string interpreted as HTML rather than a string?

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

 

Hi @saturation ,

 

Please try to refer to the following configuration and expression:

204.PNG

replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>')

 

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
edgonzales
Super User II
Super User II

@saturation 

Hi there.  I found this thread on formatting links for an HTML table, maybe that will help?

 

Keep us posted.

-Ed

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

v-bacao-msft
Community Support
Community Support

 

Hi @saturation ,

 

Please try to refer to the following configuration and expression:

204.PNG

replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>')

 

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@v-bacao-msft @edgonzales 

 

I tried the replace the whole URL and it ended up back where we started. 

 

I used replace(outputs('MyLink')?['Body']?['hyperlink'], '&lt;', '<'), '&gt;', '>') and got this (and yes, I know there's no text for my hyperlink)

 

saturation_0-1594908055823.png

 

 

Hi @saturation ,

 

We need to change the body of Create Html table action instead of individual fields.

 

Please follow the method provided by us to configure Flow or provide a screenshot of your Flow so that we can provide a suitable workaround.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
abhi0698273
Regular Visitor

As It is observed, CreateHTMLTable converts < to &lt; and > to &gt; when reading data from array, as it considers < and > as a input data.
While to have <a> markup to work, replace approach works every time.

Example Table contains -

 

{
...
link : "<a href= \"https://samplelink.tonewplace.com/person\">click here</a>"
...
}

 

gets converted to something below due to CreateHTMLTable -

 

<tr>&lt;a href= &quot;https://samplelink.tonewplace.com/person&quot;&gt;click here&lt;/a&gt;

 

So, When we replace as said earlier
Example table becomes -

 

{
...
link : "::a href= \"https://samplelink.tonewplace.com/person\":;click here::/a:;"
...
}

 

After CreateHTMLTable, result is similar to  -

 

<tr>::a href= &quot;https://samplelink.tonewplace.com/person&quot;:;click here::/a:;

 

So, now using Compose to replace the combination of characters, used earlier -

 

<tr>::a href= &quot;https://samplelink.tonewplace.com/person&quot;:;click here::/a:;

 

becomes -

 

<tr><a href= &quot;https://samplelink.tonewplace.com/person&quot;>click here</a>

 

Now above result can successfully be used as part of email.

This solution worked perfectly for me.😊

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (46,266)