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 / Deep link to specific ...
Power Apps
Answered

Deep link to specific pages & records depending on admin or user status

(0) ShareShare
ReportReport
Posted on by 47

My power app needs to open to the homepage when first opened. If the person navigating the app is an admin, they should be taken to the admin review page. If the person navigating the app is a user, they should be taken to the request review page. I have SharePoint list with a column of names and emails. I have a collection and global variable to establish if someone is an admin (varIsAdmin). 

 

On patch of a record, two emails are sent. One to the admin to prompt them to review/approve the submission and another to the user as confirmation of submission. Each email contains a link with the same url that, depending on the admin/user status of the person clicking the link, should take the admin to the admin review page and the user to the "review the request" page. 

 

The issue with my current on start statement is that if the refid isn't specifically set to zero in the url, it takes the person to the admin page with no visible record. It should take them to the homepage. 

 

https://apps.powerapps.com/play/e/[appurl]&source=portal&hidenavbar=true# (this url doesn't work and takes us to the admin page with no record visible) 

vs

https://apps.powerapps.com/play/e/[appurl]&source=portal&refid=0&hidenavbar=true# (this url works by taking us to the homepage)

 

 

//Specific User view global variable
Set(
 varUserEmail,
 User().Email
);
//Admin Access Collection
Collect(
 colAdmins,
 'Capital Tool Assignee'
);
//Admin Access Global Variable
Set(
 varIsAdmin,
 If(
 varUserEmail in colAdmins.Email,
 true,
 false
 )
);
//Deep Link record specification global variable
Set(
 varRecordID,
 Value(Param("RefID"))
);
//If there is a record #, navigate to admin page if admin and user page if not an admin, otherwise go to homepage
If(
 varRecordID <> 0 && !varIsAdmin,
 Set(
 varThisRecord,
 LookUp(
 CapitalToolRequests,
 ID = varRecordID
 )
 ) && Navigate(UserModifyRequestPage),
 If(
 varRecordID <> 0 && varIsAdmin,
 Set(
 varThisRecord,
 LookUp(
 CapitalToolRequests,
 ID = varRecordID
 )
 ) && Navigate(AdminModifyRequestPage),
 Navigate(HomePage)
 )
);

 

 Any help would be appreciated. If I need to include more info, please let me know. 

Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @gabylyons ,

     

    Please try this

    //Specific User view global variable
    Set(
     varUserEmail,
     User().Email
    );
    //Admin Access Collection
    Collect(
     colAdmins,
     'Capital Tool Assignee'
    );
    //Admin Access Global Variable
    Set(
     varIsAdmin,
     If(
     varUserEmail in colAdmins.Email,
     true,
     false
     )
    );
    //Deep Link record specification global variable
    Set(
     varRecordID,
     Value(Param("RefID"))
    );
    //If there is a record #, navigate to admin page if admin and user page if not an admin, otherwise go to homepage
    If(
     varRecordID <> 0 && !varIsAdmin,
     Set(
     varThisRecord,
     LookUp(
     CapitalToolRequests,
     ID = varRecordID
     )
     ) && Navigate(UserModifyRequestPage),
     If(
     varRecordID <> 0 && varIsAdmin&&!IsBlank(varRecordID ),
     Set(
     varThisRecord,
     LookUp(
     CapitalToolRequests,
     ID = varRecordID
     )
     ) && Navigate(AdminModifyRequestPage),
     Navigate(HomePage)
     )
    );

     

    Best Regards,

    Wearsky

  • GL-06021856-0 Profile Picture
    47 on at

    @v-xiaochen-msft 

    This didn't work exactly, but it did work when I added:

    &&!IsBlank(varRecordID )

     to both if statements. So now it looks like this:

    //Specific User view global variable
    Set(
     varUserEmail,
     User().Email
    );
    //Admin Access Collection
    Collect(
     colAdmins,
     'Capital Tool Assignee'
    );
    //Admin Access Global Variable
    Set(
     varIsAdmin,
     If(
     varUserEmail in colAdmins.Email,
     true,
     false
     )
    );
    //Deep Link record specification global variable
    Set(
     varRecordID,
     Value(Param("RefID"))
    );
    //If there is a record #, navigate to admin page if admin and user page if not an admin, otherwise go to homepage
    If(
     varRecordID <> 0 && !IsBlank(varRecordID) && !varIsAdmin,
     Set(
     varThisRecord,
     LookUp(
     CapitalToolRequests,
     ID = varRecordID
     )
     ) && Navigate(UserModifyRequestPage),
     If(
     varRecordID <> 0 && !IsBlank(varRecordID) && varIsAdmin,
     Set(
     varThisRecord,
     LookUp(
     CapitalToolRequests,
     ID = varRecordID
     )
     ) && Navigate(AdminModifyRequestPage),
     Navigate(HomePage)
     )
    );


    Thank you for the help!

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 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard