cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimmyWork
Memorable Member
Memorable Member

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

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

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.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User
Super User

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.

View solution in original post

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

Thank you @WarrenBelz that solution seems to have helped 🙂

@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

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

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)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,305)