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 Apps
Unanswered

Creating Variable

(0) ShareShare
ReportReport
Posted on by 5,345 Moderator

Seeking clarity.

I am trying to set up a variable I can use throughout my app for filtering and showing/hiding fields and galleries.

Below is my effort. What I don't understand are my '<>' results. The outcome is true, though I thought the '<>'
symbols meant 'is not equal to'. The black box is a line from the admin SP List.

My AccessLevel is 'Admin'. Shouldn't the result be 'false'?

Set(varUserMail,User().Email);
Set(varAdminRole, LookUp(AdminCollection, EmailAddress = varUserMail).AccessLevel.Value);

Phineas_2-1690994128519.png

 

Phineas_0-1690993594718.png

 

Categories:
  • madlad Profile Picture
    2,637 Moderator on at

    As far as I can tell, your syntax is correct. Can you confirm the value of varAdminRole once it has been defined like this is "Admin"? 

  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @Phineas - I'd echo what @madlad says - specifically the point that comparisons are case sensitive.

    If varAdminRole were "admin" with a lower case a, that would result in what you're seeing.

  • Phineas Profile Picture
    5,345 Moderator on at

    I've placed a label with varAdminRole

    Phineas_0-1690994896883.png

     

  • madlad Profile Picture
    2,637 Moderator on at

    Is the code to define it in the OnStart? If you've just added it, you'll have to run the OnStart at least once for it to be defined.

     

    If you've done this, something is going wrong when it's being defined - either it's not finding the record, or it's not getting the role properly. I would try to add things to this slowly while testing to see what works and what breaks it.

  • Phineas Profile Picture
    5,345 Moderator on at

    Does it matter that the 'AccessLevel' SP List column is a 'Choice' column?

    Does this influence whether the formula should have 'value' at the end?

         Set(varAdminRole, LookUp(AdminCollection, EmailAddress = varUserMail).AccessLevel.Value);

    The column in the collection looks like this...

    Phineas_0-1690997183830.png

     



  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    It looks like you AccessLevel is a multi-choice SharePoint column. In that case, you'll need to attempt to lookup the Admin row in the nested 'AccessLevel' table.

    Set(
     varAdminRole,
     LookUp(
     LookUp(AdminCollection, EmailAddress = varUserMail).AccessLevel,
     Value="Admin"
     )
    )

     

  • Phineas Profile Picture
    5,345 Moderator on at

    PA didn't like the formula.

    I know SP choice columns can be problematic, so I changed the 'AccessLevel' column to 'single line of text'.

    The new OnStart formula is -
         Set(varAdminRole, LookUp('External Meeting Request Admin', EmailAddress = varUserMail &&
         AccessLevel="Admin"));

    The circled label has the following formula. It seems to be working.   
         Label4.Text="Admin"

    Phineas_4-1691000879859.png

     

     

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard