web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract the Hyperlink ...
Power Automate
Suggested Answer

Extract the Hyperlink from an cell in Excel

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

 

I need to include the hyperlink of an excel cell into an email using flow. If I use the excel field, Flow just gives me the value of the cell, but not the hyperlink itself. On the example below, Flow gives me the string "Link" and what I need is the hyperlink within

 

ezequiel_1-1691592882249.png

Any help on solve this?

 

Thanks

 

Ezequiel

 

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @ezequiel 

     

    What's the Excel column format type? Could you use that link as a text data type?

     

    Thanks

  • rzaneti Profile Picture
    4,483 Super User 2026 Season 1 on at

    Hi @ezequiel ,

     

    An alternative is to use Office Scripts. Excel ranges allow a method called getHyperlink(), that returns an object which 'address' property is the hyperlink that you are looking for. Check the example below (the link assigned to cell B2 is 'www.google.com', and it is returned in the console, highlighted in yellow):

    rzaneti_0-1691595973076.png

     

    The code used to get access to the hyperlink object from cell B2 was: workbook.getWorksheet('Sheet1').getCell(1, 1,).getHyperlink(), and I assigned it to the 'cell_link' variable (line 2). In line 4, I'm displaying the property 'address' in the console. The 'getCell()' method is accessing the cell based on its row/column position (it is zero-indexed, so I had to use '1' to access the cell at 2nd row and 2nd column).  

     

    You can retrieve it to Power Automate by using the 'Run script' action from Excel connector. You can replicate the same code from above and just insert a return cell_link in line 5.  

     

    I recommend you to read these articles from Microsoft about the Office Scripts and its integration with Power Automate:

    https://learn.microsoft.com/en-us/office/dev/scripts/overview/excel 

    https://learn.microsoft.com/en-us/office/dev/scripts/develop/power-automate-integration 

     

    There is also this article that I wrote some time ago about the first steps with Office Scripts: http://digitalmill.net/2023/06/19/get-started-with-office-scripts/ 

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

  • Amira703 Profile Picture
    11 on at
    @rzaneti I'm not able to view the image in your post to see the code clearly. Are you able to post a larger image or paste the text of the code? Thank you!
  • Suggested answer
    rzaneti Profile Picture
    4,483 Super User 2026 Season 1 on at
     
    I don't have the image anymore, since it's a pretty old script now.
     
    The code that I've used for extract the hyperlink is: workbook.getWorksheet('Sheet1').getCell(1, 1,).getHyperlink(), where you can change the "Sheet1" for your actual worksheet name, and the values between parenthesis in the getCell for the index for the cell that you want to access. 
     
    If you want to return this link to Power Automate, you can store this value in a variable and use a return statement at the end of the main function.
     
    If you have any other specific question about the topic or need to adapt it to your particular use case, feel free to open a new thread (so we can get things better organized here in the forum) and mention me over there :)
     
    Lastly, I'm sharing some blogs that I posted about Office Scripts, which can be helpful for further reading about this feature:
    - Sending values from Power Automate to Excel with Office Scripts: https://digitalmill.net/2024/01/17/sending-values-from-power-automate-to-excel-with-office-scripts/
    - Writing data into Excel ranges out of tables with Power Automate: https://digitalmill.net/2024/08/09/writing-data-into-excel-ranges-out-of-tables-with-power-automate/
     
     
     
    Let me know if it works for you or if you need any additional help!
     
    If this solved your issue, please mark it as Accepted Answer.
    👍 If it helped, feel free to give it a like!

    🌐 Explore more Power Platform content on my Website or on my ▶️ YouTube
    💼 Find me on LinkedIn
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard