cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Super User
Super User

Re: Applying Hierarchy Control

Hi @imvivran 

 

Can you please share the schema of the mysql table that you are referring to, maybe with just some test data? I see a bit of variation in the column Name. Based on the formula used for you, I see that you are trying to map Reporting Manager to EmpID, does EmpID and Reporting Manager contain exactly same data? I mean does they both hold name of the employee?
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
imvivran
Level: Powered On

Re: Applying Hierarchy Control

@yashag2255 

 

Hi,

 

I made a few changes and it is working. Another important thing for this to work was to ensure that Office 365 should have the organization chart defined. For one client it did work as they had the organization chart defined in Office 365 but for the second client, it didn't as no hierarchy defined in Office 365. How can we use the data stored in tables for applying hierarchy?

 

I again thank you for your support. It was really helpful.

 

Rgds,

Vivek

Super User
Super User

Re: Applying Hierarchy Control

Hey @imvivran 

 

To use the data in the specific tables, you need to map the attributes based on their relationship. Please share the schema of the table that you want to use in this case and we can come up to an expression that gets the required results. Based on the previous table schema shared by you, did the expression shared by me helped?
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
imvivran
Level: Powered On

Re: Applying Hierarchy Control

@yashag2255 

 

At present my data tables are SharePoint lists and they are as follows:

 

List1 - EmployeeDetails (Contains hierarchy information)

 

Emp_CodeEmployee NameReporting E codeReporting ManagerStatusemailAddressDesignation
11001Suveer Kumar Gupta--Activesgupta@abc.comCEO
11204Dharmpal Singh11252Sumeet GargInactivedsingh@abc.comExecutive
11252Sumeet Garg11001Suveer Kumar GuptaActivesgarg@abc.comAsst. Vice President
11324Ashish Kumar Srivastava11355Renu JoshiInactiveasrivastava@abc.comSr. Executive
11336Sunny Magoo11252Sumeet GargInactivesmagoo@abc.comSr. Executive
11355Renu Joshi11899Shashank GargActiverjoshi@abc.comDeputy Manager
11460Sanjeev Kumar11252Sumeet GargActiveskumar@abc.comAsst. Manager
11544Jitendra Kumar11252Sumeet GargInactivejkumar@abc.comDeputy Manager
11549Nishee Agrawal11460Sanjeev KumarInactivenagrawal@abc.comExecutive
11551Shubham Singh Pundir11355Renu JoshiActivespundir@abc.comSr. Executive
11703Nisha Kumari11252Shashank GargActivenkumari@abc.comDeputy Manager
11704Lata Rani Sharma11899Shashank GargInactivelsharma@abc.comAsst. Manager
11708Sajjan Jha11460Sanjeev KumarActivesjha@abc.comExecutive
11899Shashank Garg11252Sumeet GargActiveshgarg@abc.comSr. Manager
11900Rajni Kumari11355Renu JoshiActiverkumari@abc.comExecutive

 

List 2 - RequestDetails (Contains list of requests raised by each employees)

 

RequestIDRaisedByDateTypeStatus
1rkumari@abc.com10-Aug-19PromotionApproved
2sjha@abc.com12-Aug-19Address ChangePending
3shgarg@abc.com25-Aug-19Salary ChangePending
4rjoshi@abc.com26-Aug-19Name changeApproved
5spundir@abc.com27-Aug-19Team ChangePending
6rkumari@abc.com27-Aug-19Team ChangeApproved
7sgarg@abc.com30-Aug-19ResignationApproved

 

Objective: A supervisor can see details of their span, including their requests. The hierarchy information is stored in EmployeeDetails table.

 

Your suggested solution worked where the organizational structure is maintained in Office 365, but it did not work where no Organizational Structure is stored.

 

Hope this is what you are asking for.

 

Thank you for helping me on this.

 

Rgds,

Vivek

 

 

imvivran
Level: Powered On

Re: Applying Hierarchy Control

@yashag2255 

 

Hi,

 

I am getting the delegation warning for the filter function. The data tables are in SQL Server

ClearCollect(
    MyIndirectReportees,
    {
        Mail: galMain.Selected.email,
        Heirarchy: 0
    }
);
ForAll(
    [
        1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20
    ],
    ForAll(
        Filter(
            MyIndirectReportees,
            Heirarchy = Value - 1
        ),
        ForAll(
            Filter(
                '[dbo].[testEmpTbl]',
                Supervisor = LookUp(
                    '[dbo].[testEmpTbl]',
                    email = Mail
                ).EmpName
            ),
            Collect(
                MyIndirectReportees,
                {
                    Mail: email,
                    Heirarchy: Value
                }
            )
        )
    )
)

 

Delegation.png

Can we make any changes to correct this?

 

Thanks,

Vivek

 

Super User
Super User

Re: Applying Hierarchy Control

Hi @imvivran 

 

Can you share the approximate number of records in your SQL table? If this is less than 2000, please update a setting as:
 
App Settings -> Advanced Settings -> Data Row Limit for Non-Delegable queries -> Set this to 2000 (Max value that can be used.)
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
imvivran
Level: Powered On

Re: Applying Hierarchy Control

Hi @yashag2255 

 

I am aware of this setting. But there are two things I am looking at here:

  1. My data table will have more than 2000 records and that is why I am using SQL table as a majority of PowerApps functions works smoothly with it.
  2. Filter function usually a delegable function with SQL, but I guess ForAll is not and that is why I am getting this message. Am I right? If this is the case then is there any workaround for this?

Once again, I appreciate your help in this regard.

 

Thanks,

Vivek

Super User
Super User

Re: Applying Hierarchy Control

Hi @imvivran 

 

There is no way to get the hierarchical results without using the ForAll loop and thats correct, this is not delegable, but this won't be a problem until a query is returning more than 2000 records. If you wish to load all the records, then you can collect everything in a collection, but this makes the app a bit slow and on the first load, it takes some time, around 5-10 seconds to get all the records. Until you have such a scenario where 2000 records are returned at a time, you can ignore this warning.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
imvivran
Level: Powered On

Re: Applying Hierarchy Control

Hello @yashag2255 

 

Thank you for your response. I will prefer to use it as a collection and then work accordingly.

 

Is there any way to reverse the hierarchy data. Based on the selection, I would like to identify the Level 1, 2, 3 or more supervisors for the selected email address. Identifying the Level 1 is fairly easy, I would like to get a collection for skip level and higher hierarchy.

 

Thanking you again.

 

Regards,

Vivek

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 48 members 4,516 guests
Please welcome our newest community members: