cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mo_Islam
Helper III
Helper III

Admin check against Sharepoint List not working

Hi

 

I have an application for which there is an Admin Screen. I have a Sharepoint List called 'Admins' in which I want a check to happen to decide if to direct to Admin Screen or User Screen.

 

  1. On Application load, I collect the Admins List: I use lower because not all email addresses in my company follow the same suite, some have caps some don't.

 

ClearCollect(AdminUsers,
    Filter(Admins,
        Lower('Staff Member'.Email) = Lower(User().Email)));​

 

  • Then, I have the check with the current user.

 

If(IsEmpty(AdminUsers), Navigate(UserScreen),Navigate(AdminHome));​

 

The problem is, this works for some users and not for others.

 

Can I use Flow instead? But How would I do a check against a Sharepoint List?

 

Any suggestions are greatly appreciated as always.

 

Thank you

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

Hi @Mo_Islam 

 

Can you try to update the configuration to:

Set(CurrentUser, User().Email);
ClearCollect(AdminUsers,
    Filter(Admins,
        Lower('Staff Member'.Email) = Lower(CurrentUser)));
If(CountRows(AdminUsers)=0, Navigate(UserScreen),Navigate(AdminHome));

 

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!

 

View solution in original post

2 REPLIES 2
rsaikrishna
Super User
Super User

@Mo_Islam 

 

When you say it is working for some users and NOT working for other users, are you able to find out for which users, it is not working? Is it because of Lower and Upper case issue?  Are the users have different domain has issue?

 

Can you provide additional info on the cases which works and not works?

 

Switching to Power Automate won't help you. 

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
yashag2255
Dual Super User II
Dual Super User II

Hi @Mo_Islam 

 

Can you try to update the configuration to:

Set(CurrentUser, User().Email);
ClearCollect(AdminUsers,
    Filter(Admins,
        Lower('Staff Member'.Email) = Lower(CurrentUser)));
If(CountRows(AdminUsers)=0, Navigate(UserScreen),Navigate(AdminHome));

 

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!

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,458)