How to Convert All Links in an HTML File into Hyperlinks in Zenphi

Sometimes, you have access to specific parts of your content using placeholders or unexported data, making it easy to format links with simple HTML like:


Zenphi actions like "Insert Content into Document" make this process seamless.

But what if your content is an entire HTML file?

Scenario

Imagine you have an HTML table, and one of its columns contains Google Docs links for each row. You need to convert these plain links into clickable hyperlinks with the name "Game Info."



Solution Approach

We will:
✅ Extract all Google Docs links from the HTML file
✅ Convert them into hyperlinks
✅ Send the updated HTML content via email

Step-by-Step Guide

1️⃣ Extract HTML Content as Text

  • Since HTML files aren't directly accessible as plain text, we need to extract the HTML code first.

Use the "Concatenate Text" action:

  • Add the HTML file content as input.

  • Add a space as the second input (to format it properly).



2️⃣ Find Document Links

  • Use a "Find Values with Regex" action to search for Google Docs links.

  • Define a regex pattern to match only Google Docs URLs (or modify it based on your needs).

3️⃣ Store the Base HTML Code

  • Create a text variable and store the original HTML content using the "Set Variable" action.



    4️⃣ Loop Through Found Links

    • Use a "For Each" loop on the extracted links.

    • Inside the loop:

      • Use the "Replace Text" action.

      • Replace the plain links with formatted hyperlinks like:




      • Save the updated HTML content back to the variable.


        5️⃣ Use the Updated HTML Content

        • Once the loop completes, your HTML content is fully updated with hyperlinks.

        • You can now send it in an email, save it, or use it elsewhere in your workflow.




Final Thoughts

With this simple Zenphi automation, you can dynamically convert links into clickable hyperlinks inside an HTML file—no manual editing required! 🚀

Let me know if you have any questions or if you’ve used a similar approach! 👇