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

Approval with link to attachments from SharePoint List

Hi there, am trying to build an automated Approval triggered from a SharePoint list which contains attachments.  I'm struggling trying get the links to the attachments included with the approval.  I have searched and see there's an upcoming release (or workaround) for attaching the actual attachments, however I am just trying to link directly to them.

 

Have tried a string and getting the DisplayName and AbsoluteUri dynamic content, but they come through as text.  Using the markdown formatting of [Link Text](Link URL) in the string variable doesn't seem to help.

 

Even if I just have the AbsoluteUri  in the string variable, it comes through the approval as text (not a clickable link).

 

Send email using the variable works (as does sending email with option), but not the approval workflow.

 

Please help, I didn't think this would be so hard?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

@Jay-Encodian , I managed to do some googling and managed to have some succuess. 

 

I changed the expression to: join(split(item()?['AbsoluteUri'],' '),'%20')

 

new method 4.jpg

 

Everything seems to be working now.  😎

 

 

View solution in original post

11 REPLIES 11
Highlighted
Super User II
Super User II

Hey @TajDomingo 

Are you trying to link directly to a file attached to a SharePoint list item?

This post may be of interest: https://powerusers.microsoft.com/t5/Building-Flows/How-can-i-add-a-hyperlink-in-the-Approval-email-L...

HTH

Jay

 

 

Highlighted

Hey @Jay-Encodian, I can do it via in Power Automate into an email, but not in an Approval....

See attachments.

link attachments to email1.jpglink attachments to email2.jpgResulting Email with clickable linksResulting Email with clickable links

 

The thread you linked to shows you can do what I'm doing but in an email with options, not an approval. 

 

Highlighted

Hey @TajDomingo 

Ok, I just did some testing on this... this doesn't work:

2.png

 It will generate something like:

3.png

The issue is caused because the URL is not encoded... this will work:

4.png

The expression is: encodeUriComponent(item()?['AbsoluteUri'])

5.pngHTH

Jay

Highlighted

Thanks @Jay-Encodian  - do you get clickable links?  It doesn't work for me:

new method 1.jpg

 

approval areaapproval area

 

emailemail

 

The test link to google works fine. But the ones to the sharepoint items do not work.

Highlighted

@Jay-Encodian , I managed to do some googling and managed to have some succuess. 

 

I changed the expression to: join(split(item()?['AbsoluteUri'],' '),'%20')

 

new method 4.jpg

 

Everything seems to be working now.  😎

 

 

View solution in original post

Highlighted

@TajDomingo 

No I can't... I've tried about 30 different way so far and I can't seem to stop the dynamic variable being written into the email as a single ordered list item in the email HTML... which is what is breaking the links.

Tables, line breaks and all the documented methods don't seem to work... I'll take a look in the morning

Cheers J

Highlighted

Sigh, so doing some more testing and Outlook (desktop) breaks this functionality, where Outlook Web seems to work?

It might be a specific scenario (of file name?) but I'm pulling my hair out with this.

 

Web outlook does this:

web outlook renderweb outlook render

 

While Outlook 2016 does this:

desktop outlook renderdesktop outlook render

 

I'm guessing its because there's '(' ')' in the filename?  Have you any other suggestions? 

Highlighted

@TajDomingo 

I've been testing by the client ... i did wonder why only partially encoding the URL worked as opposed to the full URL.

If you have the email as a HTML file you'll be able to see the issue... the full content of the variable is written is a single list item <ul>.

I have an idea... albeit it might not be very elegant!... back shortly

HTH

Jay

Highlighted

@TajDomingo 

Some progress... albeit there is a slight issue I need to try and fix:

1.png

The if expression:  if(empty(string(variables('Links')[4])),null,string(variables('Links')[4]))

The idea... (albeit not elegant), is to add each string to the details section independently, which works, however it would require you to have a consistent number of attachments.

To mitigate this; the if expression should check for a null value and only add a value if on exists... whilst the if statement works, Flow still blocks the reference to the array item when it doesn't exist... which is annoying as the expression handles it.

I'll try to fix later today

Cheers J

Highlighted

Thanks @Jay-Encodian - the number of attachments is not a constant - sometimes there might not be any at all. It might be easier to enfoce removing  ( )'s from the file names than figuiring out a work around?

 

Would it be any different using a HTML Table?

Highlighted

@TajDomingo 

The issue isn't just the URL's... even when they are correct they are not clickable as writing in multiple files from a single variable adds them as a single ordered list item in the HTML.... so even if they look correct they aren't clickable.

The last post solved that and the if expression should have taken care of not knowing how many files there were but Flow is enforcing a null reference check to a non-existent array item even though its handled.

Sorry, been v busy today... will look again tomorrow.

A HTML table is worth a go

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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.

Top Solution Authors
Top Kudoed Authors
Users online (13,335)