cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyNeutron
Helper II
Helper II

Can you save attachments in collections / Display attachments on a gallery

I have a bunch of records stored in a collection when an app boots up. A gallery reads this collection instead of the original data source. This makes it faster when filters and search terms are applied, since there won't be as much loading and the app won't need to constantly connect to the data source. I originally had it connected to the data source but now I changed it so that the gallery reads the collection. When you click on a record, you navigate to another screen and you see more details for the record in a form viewer, including an attached file you can download

 

However I noticed the sample report doesn't get saved in the collection. When I switched the form viewer from reading the SharePoint data source to reading the collection, the attachment doesn't load. All of the other fields easily get populated but I just get "There is nothing attached"

 

I was wondering if there was somehow a way to display the attached file to users. Can I save attached files form SharePoint to a collection? Or can I somehow display the attached files another way on the gallery? I'd like the attachments on the gallery so users can quickly download attachments for a bunch of records. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @JimmyNeutron ,

 

If you have tested with creating collection with

ClearCollect(colList,SPlist)

you will find that the Attachments column will not be added into this collection.

 

However, you can see there should be the ID column in the collection, so we could link the image to SP list and display the file in Image control (if there is only one image in Attachments column of each record):

First(LookUp(List,ID = ThisItem.ID).Attachments).AbsoluteUri

 

Then talking about the Form, you will need to link it directly to SP list as well as update the form, with a similar formula in Item property:

LookUp(List,ID = Gallery.Selected.ID)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

3 REPLIES 3
v-jefferni
Community Support
Community Support

Hi @JimmyNeutron ,

 

If you have tested with creating collection with

ClearCollect(colList,SPlist)

you will find that the Attachments column will not be added into this collection.

 

However, you can see there should be the ID column in the collection, so we could link the image to SP list and display the file in Image control (if there is only one image in Attachments column of each record):

First(LookUp(List,ID = ThisItem.ID).Attachments).AbsoluteUri

 

Then talking about the Form, you will need to link it directly to SP list as well as update the form, with a similar formula in Item property:

LookUp(List,ID = Gallery.Selected.ID)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

JimmyNeutron
Helper II
Helper II

Thanks! I ended up setting a gallery within a gallery. For the subgallery, I set it to:

(LookUp('List', ID = ThisItem.ID).Attachments).AbsoluteUri

Then I put an image of a generic excel spreadsheet in that subgallery. Its OnSelect property was set to:

Launch(ThisItem.AbsoluteUri). 

 

@v-jefferni 

 

From the above method, is there anyway to display the name of the file in a textbox or even the tooltip? I notice that 

ThisItem.AbsoluteUri 

Displays the link which contains the file name at the end but is there anyway to just consistently get the file name? 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,958)