cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nduati
Frequent Visitor

Delegation warning on a cascaded ClearCollect with two filter statements

Hi, I need help on how i can optimize my below statement to avoid the delegation warning on the 'in' part. A little background:

 

I am trying to get students who's  supervisor is the logged in user. Student List has a lookup field linked to Supervisor List. Supervisor list has 2 fields, the Supervisor Name of type single text(this is what is linked as lookup in the Student List) and an Email Address field of type Person or Group.

I am trying to filter using the email address field since it's the most accurate as opposed to the Supervisor Name single text field where one can easily misspell a person's name. 

 

 

ClearCollect(
    StudentList,
    Filter(
        'Student List',
        Supervisor.Value in Filter(
            Supervisors,
            'Email Address'.Email = _currentUser.Email
        ).'Supervisor Name'
    )
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerAddict
Super User
Super User

Can you store the Supervisor profile first in a variable?

Set(currSupervisor, 
        LookUp(
            Supervisors,
            'Email Address'.Email = _currentUser.Email
        )
);

And then change your expression to:

ClearCollect(
    StudentList,
    Filter(
        'Student List',
        Supervisor.Value = currSupervisor.'Supervisor Name'
    )
);

I believe the syntax should be right but I haven't tested it, so let me know if this works. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

3 REPLIES 3
PowerAddict
Super User
Super User

Can you store the Supervisor profile first in a variable?

Set(currSupervisor, 
        LookUp(
            Supervisors,
            'Email Address'.Email = _currentUser.Email
        )
);

And then change your expression to:

ClearCollect(
    StudentList,
    Filter(
        'Student List',
        Supervisor.Value = currSupervisor.'Supervisor Name'
    )
);

I believe the syntax should be right but I haven't tested it, so let me know if this works. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

View solution in original post

Hi Hardit,

You are amazing! Thank you so much. Not sure how that completely skipped my mind yet i am totally familiar with it. I guess i need a break 😊😊

Always good to take a break 🙂 

 

Glad I could help! Good luck with the rest of the app! Feel free to reach out in case of any questions!

 

Thanks!

Hardit Bhatia

Microsoft Business Applications MVP

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,996)