web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Putting SharePoint row...
Power Apps
Answered

Putting SharePoint row values into variables

(0) ShareShare
ReportReport
Posted on by 316

Hi,

I have a table that has a list of users, emails and parts of the app they are allowed to have access to:

Iamglt_0-1612497504214.png

What I am trying to do is on App Start, search this table and if my username matches an entry, then if HRAccess, SecurityAccess and AdminAccess are yes then the end user will have access to those screens which have a 'Yes' marked on them.  I have the following collection:

 

ClearCollect(
 varAccessCheck,
 Sort(
 NewEmployeeAccess,
 ID,
 Descending
 )
);
Set(varEmail,First(Filter(varAccessCheck,'EmailAddress');
Set(varHR,First(Filter(varAccessCheck,'HRAccess');
Set(varAdmin,First(Filter(varAccessCheck,'AdminAccess')

 

Can anyone advise why my code is not working and if I should create global variables as above, then reference them across my screens in my app or if I should create a collection at each screen and check there? Please note that using Office365 groups to control screen access is not an option here.

Cheers,

Geoff.

Categories:
  • Verified answer
    eka24 Profile Picture
    20,925 on at

    @Iamglt 

    I suggest you use LookUp.

    ClearCollect(
        varAccessCheck,
        Sort(
            NewEmployeeAccess,
            ID,
            Descending
        )
    );
    Set(varMail,User().Email);
    Set(varHR,LookUp( varAccessCheck,EmailAddress=varMail,HRAccess));
    Set(varAdmin,LookUp( varAccessCheck,EmailAddress=varMail,AdminAccess));
    Set(varSecurity,LookUp( varAccessCheck,EmailAddress=varMail, SecurityAccess));

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard