question

NestorHolynskyj-2689 avatar image
0 Votes"
NestorHolynskyj-2689 asked DennisKuhn-3073 commented

Embedding HTML code in Power Automate table

I have a Power Automate flow that uses the "Create HTML Table" function as one of its steps. One of the fields in the table is a URL address. The latter can be quite long and makes the display of the table in the email to which it is sent quite crowded. The link appears as the full address. I would prefer to have a label displayed so that when it's clicked the reader gets sent to the underlying link. I know how to create a labeled link in a regular HTML page. However, I'm trying various ways to embed the labeled URL into the table created by Create HTML Table. For example, I've something like this: <a href="https://google.com">Click for Google</a>. The table that is generated shows the link but ignores the label section.

Any advice?

sharepoint-workflow
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NestorHolynskyj-2689 ,

To understand you better, could you please share here a sample screenshot of the action Create HTML Table on your end?

0 Votes 0 ·

Here you go... I'm showing the two related steps: the Select Fields step (note the "Email" field that is pulled from Dynamic Content) and the next step which creates the HTML table. FWIW, I've also included a text file with the code behind the Select Fields step.
Thanks in advance for you help.

159746-screen-shot-2021-12-22-at-84327-am.png


159717-code-peek.txt


0 Votes 0 ·
AllenXu-MSFT avatar image
0 Votes"
AllenXu-MSFT answered DennisKuhn-3073 commented

Hi @NestorHolynskyj-2689 ,

The key is that ‘<’ and so on are reserved characters in HTML, they are escaped as text, so they cannot be recognized. Finally I solved this issue by using expression replace(replace(replace(body('Create_HTML_table'),'&lt;','<'),'&quot;','"'),'&gt;','>') here:
160516-image.png

An email I got from above flow:
160517-image.png


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


image.png (83.3 KiB)
image.png (39.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Awesomestness, thanks a lot for sharing ;-)

0 Votes 0 ·
NestorHolynskyj-2689 avatar image
0 Votes"
NestorHolynskyj-2689 answered

Outstanding! You absolutely rock! Saved me days of frustration... Thanks

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.