I'm working on a power app that is used for document automation. I have a list of documents that are stored in both dataverse and SharePoint that I would like to be able to download individually or in bulk. The document list uses the dataverse table that stores the files in a custom gallery.
Initially, I was using an API that gets the dataverse file column and I just dynamically changed the id in the URL for whichever file(s) were selected and used the Download() function. This works well except for the fact that it only works for one user session, and then once that session is over the API becomes invalid. If I try looking up the record and providing the File column for that record or the File.Value, it says that the URL is invalid (for Launch and Download). I also tried using the Download() and Launch() function with SharePoint URLs but when I did it in bulk, it would only download the first or last selected file depending on whether I was using Launch() or Download(). Another issue with using the SharePoint URLs is that when you use the power app in Teams, it opens a browser tab for each selected file and requests authentication for each one and then only downloads one of them anyways. I've also tried using power automate to create a download link or provide the file to the power app somehow but to no avail.
It seems to me that the core of my problem is that I need some way to authenticate users within the power app so that I can have a new auth token for each session, allowing me to use the dataverse api or to not need to authenticate for every download through sharepoint.
If there is anyway to add that authentication or another means of downloading the file(s), please let me know. If you need any further information I'll be happy to provide it.