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 / Redirect unauthorized ...
Power Apps
Answered

Redirect unauthorized user

(0) ShareShare
ReportReport
Posted on by 15

I have an issue with Screen On visible parameter condition if user unauthorized else navigate, in case user is not authorized to view a specific in screen, then the user will be redirect to another screen. if there is any another option please provide me with a solution.    

 

 

 

If(
 IsBlank(
 Param("ID")
 ),
 0,
 If (
 LookUp(
 <<Table_Name>>, 
 <<Field_name>> = Param("ID"),
 <<Field_name>>
 ) = Office365Users.MyProfile().Mail,
 Param("ID"),
 Navigate(Auth_404)
 )
)

 

 

 

 

 Thanks in advanced

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @MustafaAlqanbar ,

    Could you please share a bit more about the issue on your side?

    Do you want to check if current sign in user is a authorized user, if yes, navigate him to the specific screen, if not, navigate to a Auth_404 screen?

     

    Based on the formula you provided, I think you are in right direction. I have made a test on my side, please consider take a try with the following workaround:

    Set the OnStart property of App to following:

    If(
     !IsBlank(Param("ID")),
     If(
     LookUp(Table_Name, Field_Name = Param("ID"), Field_Name) = Office365Users.MyProfile().Mail,
     Navigate(SpecificScreen), /* <-- Navigate to a specific screen */
     Navigate(Auth_404) /* <-- Navigate to Auth_404 screen */
     )
    )

    In addition, it is not necessary to add Office 365 Users data source in your app, I think the User() function could achieve your needs. Please consider modify above formula as below:

    If(
     !IsBlank(Param("ID")),
     If(
     LookUp(Table_Name, Field_Name = Param("ID"), Field_Name) = User().Email,
     Navigate(SpecificScreen), /* <-- Navigate to a specific screen */
     Navigate(Auth_404) /* <-- Navigate to Auth_404 screen */
     )
    )

     

    Actually, you could consider use a data source to store the authorized users, and then add this data source into your app. Then within your app, you could check if the current sign in user is existed in the data source directly. You could set the OnStart property of the App to following:

    If(
     User().Email in Table_Name.EmailColumn,
     Navigate(SpecificScreen),
     Navigate(Auth_404)
    )

    or

    If(
     User().FullName in Table_Name.DisplayNameColumn,
     Navigate(SpecificScreen),
     Navigate(Auth_404)
    )

    when your load your app, the above formula would be executed to check if the current sign in user is a authorized user.

     

    Best regards,

  • LEARN_IT Profile Picture
    130 on at

    Hi, this is great an I was using it. But now Powerapps It's not allowing to use the Navegate function OnStart. Please help.

    thanks

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
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard