function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Allen ManamelAllen Manamel 

Display multi-level records to user via lightning flow

This is my use case. I have some community users and I want them to see the records only relevant to them.
I have an object 'Account' and a child object 'Point of Contact'. Account object has another child object 'sub-accounts'. Further sub-accounts has a 'Point of Contact' object too as well as another child object 'communication'. What I want is when a community user logs in, the system checks if the logged in user is listed as a user in "Point of Contact' object. If yes then he should be able to see that account/s as well as sub-accounts and the 'communication' records under it. Basically he should be able to see all level of records associated with that particular account. Second scenario, if the user is not listed in any of the 'Point of Contact' record related to a particular account, the system checks if he exists in any of the'Point of Contact' records that exists under 'Sub-accounts'. If yes, then the person should only be able to see that particular 'sub-account'(and not the parent account) as well as the communication records under that particular sub-account only.

Here is the screenshot of the hierarchy. 
User-added image

My question is is it possible to achieve this using a flow? such that the flow only does the condition checking and display records and does not really take any input from user at this point. or is there any other way to achieve this in Salesforce? Sharing rule does not seem to cater these complicated conditions.