cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alunhughes
Level: Powered On

Open SharePoint List Attachment from PowerApps

Hi,

 

I've created a PowerApps form using a SharePoint list and used the Attachment column. My form uploads the attachment to the SharePoint list with no problems (I only want to include max 1 attachment per list item).

 

I want to be able to open the attachment from an icon used within a gallery (open in browser is more than sufficient) so was thinking along the lines of the Launch() feature and construct a URL for the location of the attachment (i.e https://MY-TENANCY/sites/SITE-NAME/Lists/LIST-NAME/Attachments/{ID}/{ATTACHMENT-DISPLAY-NAME})

 

I see an attachment display name as a control but not sure how to construct the string for this command.

 

Can any one help?

 

Many thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Open SharePoint List Attachment from PowerApps

Hi @alunhughes ,

Do you want to open the Attachment (single one attachment) via pressing the icon in your Gallery?

 

Based on the needs that you mentioned, I think it is not necessary to construct a URL string for the location of the attachment of a SP List Item.

 

I have made a test on my side, please consider take a try with the following workaround:

6.JPG

 Add a Icon within your Gallery, set the OnSelect property to following:

Launch(First(ThisItem.Attachments).AbsoluteUri)

Note: The First(ThisItem.Attachments).AbsoluteUri formula would return the URL of the attachement file of a SP List Item.

 

In addition, if you want to force attaching only once file to each SP List Item, please consider set the Max attachments property to 1 as below:

7.JPG

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
ricardosanchezm
Level: Powered On

Re: Open SharePoint List Attachment from PowerApps

Hi @alunhughes ,

If you are using a gallery to open the attachment in a web browser you can do the following.

Launch(Concatenate(GalleryName.Selected.AbsoluteUri;"?web=1"))

 It will get the full path of the attachment and concatenate the string "?web=1" to open it in a new browser tab.  I have a gallery with a list of attachments with this command and works perfectly.

Regard,

Community Support Team
Community Support Team

Re: Open SharePoint List Attachment from PowerApps

Hi @alunhughes ,

Do you want to open the Attachment (single one attachment) via pressing the icon in your Gallery?

 

Based on the needs that you mentioned, I think it is not necessary to construct a URL string for the location of the attachment of a SP List Item.

 

I have made a test on my side, please consider take a try with the following workaround:

6.JPG

 Add a Icon within your Gallery, set the OnSelect property to following:

Launch(First(ThisItem.Attachments).AbsoluteUri)

Note: The First(ThisItem.Attachments).AbsoluteUri formula would return the URL of the attachement file of a SP List Item.

 

In addition, if you want to force attaching only once file to each SP List Item, please consider set the Max attachments property to 1 as below:

7.JPG

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
alunhughes
Level: Powered On

Re: Open SharePoint List Attachment from PowerApps

Thank you both for your help.

 

This is exactly what I need - a much simpler way using the AbsoluteUri (which I was unaware of). I had already set the max attachments to 1 🙂

 

Thanks

Dawidvh
Level 10

Re: Open SharePoint List Attachment from PowerApps

Hello everyone. In case you still have questions on the topic, we go through this in some more detail.

Display SharePoint List Attachments in PowerApps (2019)

 

The .AbsoluteUri requires the user to be logged into the SharePoint front-end (which is not always the case obviously), while .Value uses the SharePoint connector to fetch the attachment(s) so this is a better option.

 

Dawid van Heerden

Follow on Twitter: @davestechtips

Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,052)