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 Apps / Gallery with collectio...
Power Apps
Answered

Gallery with collection to filter another gallery to show attachments from sharepoint item

(0) ShareShare
ReportReport
Posted on by 2,563

What i have done is that i have two galleries one gallery uses a collection the other gallery the SharePoint list directly.

Gallery1 = Collection gallery

Gallery2 = SharePoint list gallery (Hidden gallery)

 

Gallery1 OnSelect = Set(varTicketID, ThisItem.TicketID);

Gallery2 items = Filter(SharePointList,(TicketID = varTicketID))

 

So when i click on an item in Gallery1 it is listed in Gallery2 by filtering. I do this because of delegation and that i want to get the attachments and i cannot do that in a collection but in Gallery2 i can get the attachments for the selected SharePoint item and display then in powerapps.

 

I then have a Attachment control that is set to Gallery2.Selected.Attachments

But sometimes it does not really list the attachments even if they are there it shows blank, if i click 2 times it is always listed. How can i make this more stable maybe using the update function or something? Please see the image below for showing the issue.

 

test.gif

 

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    Hi @JimmyWork ,

    You have a refresh (or lack of) issue going on here. 

    Happy to work though this with you - you are doing something a bit adventurous here, so this is not necessarily straight forward.

    The first thing you might try is

    Set(varTicketID, ThisItem.TicketID);
    Refresh(SharePointList)

     Let me know if this makes a difference.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • JimmyW Profile Picture
    2,563 on at

    @WarrenBelz Thank you again 

    I will try the refresh part later tonight and update if it solved it, currently what i do is that i will display an icon if there is an attachment if the icon is there and it does not display the attachments on the first click i can always click again a second time and it will show. As this is not for the users interface i would say it is currently acceptable but of course I would like it to work perfect 🙂

  • JimmyW Profile Picture
    2,563 on at

    Thank you @WarrenBelz that solution seems to have helped 🙂

  • JimmyW Profile Picture
    2,563 on at

    @WarrenBelz I was to fast, each time i do a refresh the items shows or removes.

    It will always say has attachments correctly but will only display the attachment each other time i do a refresh of the SharePoint list

     

    I have a button that i set to Refresh(SharePointList)

    This is what happens when i run it.
    Can i have something on the screen that messes with it? I tried looking everywhere but not able to find anything.
    I do new ClearCollects but thats all i do and the item is linked to selected item as i described on top.

     

    test1.gif

  • JimmyW Profile Picture
    2,563 on at

    @WarrenBelz Sorry for all the tags i did some more testing and for some reason this works but i dont understand why i can't remove any clearcollect and so on.

     

    - 1st Button does a Refresh(SharePointList) and the navigates you to the second screen

    - Screen2 onVisble = ClearCollect(RecordsTickets,Filter(SharePointList,Status.Value = "Unassigned" ));

    - Gallery1 onSelect = Refresh(Helpdesk);ClearCollect(RecordsTickets, SharePointList); and sets variables for ticketId and navigates to screen3

    - Screen3 = no refresh or clearcollect, everything is displayed correctly.
    - Back button on Screen3 onselect= ClearCollect(RecordsTickets,Filter(SharePointList,Status.Value = "Unassigned" )); Back()

     

    This way everything works if i remove any clearcollect or refresh it works only each other time, i cant wrap my head around why or even what im doing so many collects for now.

    Maybe it just about delays, can i create a delay?

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    Hi @JimmyWork â€˜

    I am in a different time zone to you (6am Sunday morning here) so have just got back to this.

    You can do a delay with a timer control (you can hide it). Set a Variable when you want it started and set the a timer Start property to this variable, then set the timer OnTimerEnd to  the action you require, with the Duration in milliseconds (2000 = 2 seconds)

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 Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard