cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How to add dynamic Links in Approval action?

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: How to add dynamic Links in Approval action?

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



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

12 REPLIES 12
Highlighted
Dual Super User III
Dual Super User III

Re: How to add dynamic Links in Approval action?

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



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Regular Visitor

Re: How to add dynamic Links in Approval action?

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.
Highlighted
Dual Super User III
Dual Super User III

Re: How to add dynamic Links in Approval action?

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



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted
Regular Visitor

Re: How to add dynamic Links in Approval action?

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

Highlighted
Regular Visitor

Re: How to add dynamic Links in Approval action?

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?

Highlighted
Dual Super User III
Dual Super User III

Re: How to add dynamic Links in Approval action?

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.


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Regular Visitor

Re: How to add dynamic Links in Approval action?

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

Highlighted
Dual Super User III
Dual Super User III

Re: How to add dynamic Links in Approval action?

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Regular Visitor

Re: How to add dynamic Links in Approval action?

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

Highlighted
Regular Visitor

Re: How to add dynamic Links in Approval action?


@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.

Highlighted
Frequent Visitor

Re: How to add dynamic Links in Approval action?

How did you convert the string's space characters to that format?  I have the same problem with a link that end "Fancy Invoice.pdf" where the last part 'fancy.pdf' is separated out of the link. 

Highlighted
Dual Super User III
Dual Super User III

Re: How to add dynamic Links in Approval action?

There is a substitue() function that will let you substitute one substring for another.  Simply swap ' ' with '%20'  for example

Substitute( "Old name.pdf", " ", "%20")


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (6,836)