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 / How to add dynamic Lin...
Power Automate
Answered

How to add dynamic Links in Approval action?

(1) ShareShare
ReportReport
Posted on by 29

I have list where user create new item and upload multiple files. Now once the item is created, I need to run a flow that will copy this item attachment to other library. Then I need to run approval for this item. I am using "Get attachments" for getting the attachment links. I am manuplulating the path to be fetch from the document librayry. I am storing all the links in a text variable in below format:

(File Display name)[file path]  (File Display name)[file path]  ....

reference link - https://docs.microsoft.com/en-us/flow/approvals-markdown-support

When I use Approval action, I am inserting this in body, I am getting below result:

image_2019_09_03T04_49_48_320Z - Copy.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I have also try to generate html and put in body, but it seems only markdown formatting is supported. Can any one suggest me how can I achieve this? Is there any way I can leverage Item link option?

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,383 Most Valuable Professional on at

    I think the problem is that the markdown code is swapped out for actual formatting at the same time your variable is being inserted.  So its not recognizing the contents of the string as markdown.  I think what you will have to do is actually use the markdown characters and insert dynamic content fields into those characters.  Something more like this.

    screenshot.png

  • LoveThakker Profile Picture
    29 on at
    Hi,
    I think I missed few details. I need to send only one approval for all attachments. As user can upload n number of attachment, I am not sure how to pass markdown values as you have shown in figure.
  • Verified answer
    Pstork1 Profile Picture
    69,383 Most Valuable Professional on at

    If you have an unknown number of attachments try building out your Details in a compose rather than as a variable and make sure you reference the attachment fields as JSON objects.  Something like this

    Here is a dynamic link being generated
    [@{variables('Document Name')}](@{variables('Document URL')}

    Then input the Compose output as the Details in the Approval

  • LoveThakker Profile Picture
    29 on at

    Just a minor update to the answer. We need to close the bracket after document URL variable. So my value will look as below:

     

    Here is a dynamic link being generated
    [@{variables('Document Name')}](@{variables('Document URL')})
    Do not close ']' bracket.

    see below image for reference 

    compose action.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi. I am trying same as you suggested. Still I am getting the sting object in email. See below screenshot for same:

     

    My Flow - 

     

    flow 1.pngflow 2.pngflow 3.png

     

    Email that I recieve 

     

    compose issue.png

     

    Can you tell me what I am missing?

  • Pstork1 Profile Picture
    69,383 Most Valuable Professional on at

    I see a couple things in the output that may be causing the issue.

     

    1. Make sure you add a space before or after links when you append them in the compose.  Without the whitespace I don't think its interpreting them as markup.
    2. YOu've got ["    .....  "] brackets and quotes around the output of the formatted markup.  I don't see in your Flow where that is coming from, but that would cause a problem also.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have added space after link and it is showing space in mail but formatting is still an issue. 

     

    compose issue 2.png

     

    I am not sure why it is giving me ["  "]. @Pstork1 - If you can provide any hint for this, it will be really helpful

  • Pstork1 Profile Picture
    69,383 Most Valuable Professional on at

    Its something about the way you are doing your compose.  I would have to try to duplicate it to figure out what its doing, but the output of your compose seems to be a Json object rather than a concatenated string. YOu might try creating a thrid variable of type string and then using an Append to String action inside the loop in place of your compose.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    my initial try was using string variable. I am not getting mark up formatting that way.

    compose issue3.png

     

    and out put looks as below:

     

    compose issue3.1.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Pstork1 wrote:

    Its something about the way you are doing your compose.  I would have to try to duplicate it to figure out what its doing, but the output of your compose seems to be a Json object rather than a concatenated string. YOu might try creating a thrid variable of type string and then using an Append to String action inside the loop in place of your compose.


    Got the solution. With string what I was missing was, the URLs were having space and that was breaking the URL part. I need to replace space with %20 and it worked as expected.

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
Valantis Profile Picture

Valantis 641

#2
Vish WR Profile Picture

Vish WR 640

#3
Haque Profile Picture

Haque 495

Last 30 days Overall leaderboard