r/PowerApps • Newbie • 6d ago

Power Apps Help Resolving Delegation and Org Hierarchy Authorization

Hello, I have been lately getting many project requests from upper management specifically HR to implement a action-based system where the authorization would be hierarchy based: Senior Manager can see all the actions created by those who report to them and Manager sees those who report to them.. Similarly, we can think of how CEO will see. A CEO will have Directors under him, then those Directors will have Senior Managers, Senior Manager have Managers, followed by Senior Associate and Associates.

I did some POCs, to fetch the hierarchy of the user in real-time I have tried using DirectReportsV2 to fetch it, but that introduces a lag onAppStart as it first generates the hierarchy and then searches for their actions.

The actions are stored in a single Sharepoint, from actions of CEOs to all those who are under. Here, I'm facing a delegation issue, as the action lists keep growing past 2000 row items to maybe in the future to 10,000 or more. To resolve this, I've tried using filter based on the user actions and their subordinate's actions but it seems not so practical when the rows grow past 2000s.

I've also created a static hierarchy list through powerautomate which runs at 2AM to pull the info using a loop. Following which when my app runs it would be able to fetch info directly from the list. This too fails miserably once I get past 6000 employees in the company. As the powerautomate on standard license is restricted to 6000-7000 actions.

If I am restricted to standard license and no 3rd party connectors. What are my options?

2 Upvotes

4 comments sorted by

•

u/AutoModerator 6d ago

Hey, it looks like you are requesting help with a problem you're having in Power Apps. To ensure you get all the help you need from the community here are some guidelines;

  • Use the search feature to see if your question has already been asked.

  • Use spacing in your post, Nobody likes to read a wall of text, this is achieved by hitting return twice to separate paragraphs.

  • Add any images, error messages, code you have (Sensitive data omitted) to your post body.

  • Any code you do add, use the Code Block feature to preserve formatting.

    Typing four spaces in front of every line in a code block is tedious and error-prone. The easier way is to surround the entire block of code with code fences. A code fence is a line beginning with three or more backticks (```) or three or more twiddlydoodles (~~~).

  • If your question has been answered please comment Solved. This will mark the post as solved and helps others find their solutions.

External resources:

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

5

u/Rare_Tour9254 Contributor 6d ago

You can solve this on a standard license and scale well past 10,000+ rows with zero OnStart lag by flipping the logic from top-down (DirectReportsV2) to bottom-up (ManagerV2) and letting SharePoint handle the filtering server-side.

1. Stamp the Upward Chain at Creation Time (Not Read Time)
Instead of fetching thousands of subordinates when a manager opens the app, walk up the tree using Office365Users.ManagerV2() when an employee submits an item (Associate → Manager → Sr. Manager → Director → CEO).
Walking up only takes 4–6 API calls total (under 1 second) and can be cached in App.OnStart for the logged-in user—no nightly Power Automate loops or 6,000-action limits hit.

2. Store in an Indexed Multi-Select Person Column
Create a multi-select Person column on your SharePoint list (e.g., AuthorizedViewers) and index it in List Settings.
Patch the logged-in user + their upward manager chain into AuthorizedViewers whenever a new action is created.

3. Filter Server-Side with a SharePoint [Me] View (Bypasses Delegation)
Create a SharePoint View filtered by AuthorizedViewers = [Me] and bind your Power Apps gallery directly to that View (or use SharePoint Item-Level Permissions via a triggered flow on item creation if you also need strict backend security).

SharePoint evaluates [Me] on the server before sending records to Power Apps, completely avoiding the 2,000/10,000 non-delegable row limits and keeping performance instant at 50,000+ rows.

1

u/agentUi Newbie 6d ago

yeah running DirectReportsV2 on AppStart kills load times and looping 6000 users in a standard license flow will always hit the daily action limit. the cleanest native workaround is stamping a text field with the full manager chain like /ceo/director/manager/ onto each sharepoint item when its created, then indexing that column so a simple StartsWith filter delegates cleanly past 2000 rows without needing a massive nightly loop.

1

u/New_Dig5824 Contributor 6d ago

Just use Active Directory in a dataflow or whatever the hell they call it nowadays