Hi guys,
I have a SharePoint list connected to my Power App, which is not getting any data using it on an OnSelect of an icon
while it is showing me data in a galary
Has someone experienced such behaviour befor and do you know how to fix this?
I guess there is some confusion on what I am trying to achiev. I will try to explain it.
I have a list with many items, each wit exactly one attached file. But there might be more then one of the same category. So my gallary should show all possible categories first. I already achived this by
Distinct(Trainings, Category)
Now my galary looks like this:
Now by selecting the download icon, I want to download the attached file of the first list item of the selected category. I tried with this:
Download(First(First(Filter(Trainings, Category=ThisItem.Result)).Attachments).Value)
as well as with this:
Launch(First(First(Filter(Trainings, Category=ThisItem.Result)).Attachments).Value)
The Download function gives me a Runtime error saying: The URL passed to the function is not valid.
Launch instead opens a new tab with the about:blank page.
I traced the issue to be that my Trainings list delivers no data in my IconDownload.OnSelect
What I don't understand is why, since my galary works fine.
But maybe I am having some other error. I am grateful for any help.
You can't launch the list item for download outside of the context of the app or the SharePoint list. If you want to download some of the data the easiest way would be to create a display form on a print page and set the item property to do a lookup based on the Gallery.Selected.Category.someuniquevalue. Then you could print the form or screenshot it.
Hi @Pstork1
thanks for your reply.
Actually I am trying to make a download of the first SharePoint list item having the same "Category" as the gallary item.
So this was somehow what I had, opening an empty tab.
Launch(First(First(Filter(Trainings, Category=ThisItem.Result)).Attachments).Value)
Can you explain what you are trying to do in the OnSelect? Are you trying to apply a filter to data showing in gallery or table? If you are then the filter() statement needs to be in the items property of the gallery. In the OnSelect you would normally set a variable value to be used in the filter function elsewhere.
Set(varCategory, thisitem.category.result) <--code for onselect
filter(Trainings, Category=varCategory) <-- items property of Gallery
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional