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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Access control in appl...
Power Apps
Unanswered

Access control in application

(1) ShareShare
ReportReport
Posted on by 98

Goodnight

I developed an application to control overtime and when accessing the application I have 2 options.

Management and Employee

Employees will not be able to access the management part.

In the On start tab of the app, I configured it like this:

Set(varacesso;LookUp('List of administrators controlling overtime';varacesso = "Admin";Access))

And on the management button in On Select like this:

If(access access = "Admin"; Navigate(Governance);Notify("No access to management area"))

With this configuration, the "Management" and "Employee" user access does not work.

Categories:
I have the same question (0)
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @Fioravanti ,

    It looks like there's a logical issue with the use of varacesso in your OnStart formula. Ensure that you first set a variable to the current user's details and then use that variable to look up the access level. Here’s a corrected version of the OnStart formula:

    Set(varUser, User().FullName);
    Set(varacesso, LookUp('List of administrators controlling overtime', FullName = varUser, Access));

    Replace FullName with the actual column name that stores user names in your data source. Then, in the OnSelect formula of the management button, you're correctly checking varacesso and using Navigate and Notify functions based on the user's access level.

    Please accept this solution if it resolves the issue. ✅
    Best regards,
    Muhammad Ali

  • miberr Profile Picture
    17 on at

    Hi @Fioravanti! If I got your use case correctly, you don't seem to have a comparison of the current user and the record in your list. It would look something like this: 

    Set(varAccess;LookUp('List of administrators controlling overtime';email = User().Email).isManager)

    I also recommend that you use email as an identifier, since its always unique, users names may not be.

     

    Please accept this as a solution if it resolves your issue, thanks! ✅

  • Fioravanti Profile Picture
    98 on at

    My list, but dont start

  • Fioravanti Profile Picture
    98 on at

    My list access

  • Verified answer
    M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @Fioravanti ,

    It seems there is a variable reference issue in your Power Apps configuration. When initializing varacesso in the OnStart event, make sure you're setting it with the current user's access level correctly. Use this revised OnStart code:

    Set(varUser, User().FullName);
    Set(varacesso, LookUp('List of administrators controlling overtime', FullName = varUser).Access);

    Make sure 'FullName' matches the column name in your list. For the OnSelect event of your management button, the condition should check varacesso like this:

    If(varacesso = "Admin", Navigate(Governance), Notify("No access to management area"));

     Check that your list name and columns are correct and that the app has permissions to access the list. For troubleshooting, you can display the varacesso value after setting it to confirm it's capturing the correct data.

    Please accept this solution if it resolves the issue. ✅
    Best regards,
    Muhammad Ali

  • Fioravanti Profile Picture
    98 on at

    Solved, thank you very much.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard