I have a flow getting triggered from a Power App button. This flow has a SharePoint 'Get Items' action with a filter to get items matching a certain value in one of the list columns, but it doesn't return results matching the criteria if the items are created by another user.
Scenario:
User1 has created an item with the value 'test' in field 'name'
User1 is triggering the flow from power app, and the 'Get Items' action returns the item he created
User2 is triggering the flow from power app, and the 'Get Items' action returns null
The list does have unique item level permissions, but this is happening for items with same permissions as well.
The connection used for the action is of a site owner, that has read/write access to all the items.
Are you saying that the Get items still doesn't work after changing the list settings? If so, did you refresh the connection (drop and re-add it) after making the change to pick up the change in Power Automate?
Yes, understood. When I disable the settings but if the approval flow is still on, I still get null results.
You're right, the flow is triggered from a Power App button. I see that the flow is getting and creating SP items with the context of the logged in Power App user, and not the connection's credentials.
From a permission standpoint yes, but the stuff in the advanced settings isn't permission. It just filters out anything the current user shouldn't be able to see. its not permissions its filtering. So even though the permission is there it still filters based on the current user.
What trigger are you using for the flow? This can effect the context of the connection.
Yes, this setting is set to be accessible as 'item created by the user'. I also have an approval flow running which stops sharing the item with all users except owners and gives read access to the author of the item. (We don't want the users to be able to edit their requests after submission)
When I disable both, this setting and the approval flow, the get item action works fine.
But what I don't understand is, why this is happening, since my flow uses the connection of a site owner, who has read/edit access to all the items? Shouldn't the flow execute the get query using the owner's credentials irrespective of who has triggered the flow?
Check the settings of the list. There are settings in the list that let you hide items from non-administrator users who didn't create them. Its under the advanced settings. It can limit Read and Edit access to items created by the user.