TLDR: Users have read-only access to SP library. New PowerApps form for allowing users to upload files into library with proper metadata uses Flow's "Create a File" to do the upload. Since users have read-only access the flow fails. This is because the flow is run using the user's permission. How can I work around this?
Situation:
I have a Sharepoint library called "Document Library". All users have read permissions in the Document Library and item-level permissions to edit documents for which they're the caretaker. Now I want to let users upload documents themselves. I created a PowerApps form that allows them to upload files and forces them to input the required metadata. Everything works fine for me as the Owner but the form fails to upload the file for users because they only have read permissions to the library.
My understanding is flows triggered by PowerApps run as the user. This is different from flows triggered outside of PowerApps where the flow can run using a different user's connection (e.g. a user can initiate a flow which runs using the admin's connection giving it the rights to create/edit any file).
How can I work around this?
Info
Here's where the flow fails for users:
The error I get is:
Access denied.
clientRequestId: b16cb46d-c87b-4983-8975-8a09e3795b16
serviceRequestId: b16cb46d-c87b-4983-8975-8a09e3795b16
I verified this is a permissions issue by initiating a flow as a normal test user. That failed. But when I gave the test user edit writes to the SP library, then everything ran fine.