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 / Launch URL based on de...
Power Apps
Answered

Launch URL based on department in the On Start control

(0) ShareShare
ReportReport
Posted on by 45
Hello everyone,
 
I am hoping this is possible but its not looking like it is but I figured I'd ask the experts. 
 
I have a pair of power apps I created and I would like the apps to automatically redirect  a user in a specific department to their department's dedicated app should they enter the incorrect app. 
 
I put the launch function in the on start control and it works fine as long as I am using the actual URL for the power app. The issue is I have the app embedded on a SharePoint page and the On start launch function doesn't seem to work when using the embedded app. 
 
Is there a way to get this to work or would this have to be done on SharePoint itself?
 
Thank you in advance for your insight. 
Categories:
I have the same question (0)
  • scalca Profile Picture
    252 Moderator on at
    can you pls share the onstart function ?
  • SG-09091339-0 Profile Picture
    45 on at
    @scala
     
  • Verified answer
    MarkRahn Profile Picture
    1,351 Super User 2026 Season 1 on at
    I was able to get this to work. I tried to duplicate what you might have done.
     
    First I tried to use the "Microsoft PowerApps" webpart.

    This loaded my Power App, but the Launch function did not execute.
     
    I switched to using the "Embed" web part.

     
    For the code, it has to be in a specific format:
    <iframe width="1024px" height="768px"
    src="https://web.powerapps.com/webplayer/iframeapp?source=iframe&
    screenColor=rgba(104,101,171,1)&
    appId=/providers/Microsoft.PowerApps/apps/YourAppID"></iframe>

    I added line returns for readability.
    Reference: Embed PowerApps on SharePoint Pages - Microsoft Power Platform Blog
     
    Replace YourAppID above with the App ID from the Details dialog in Power Apps Studio where you got the App Link Url.
     
    This is an older method, but the Launch worked to switch to another page.
     
    While testing this, I did not add any conditions to the Launch function. This caused the Launch to happen even when I was editing the Page in SharePoint. Opps!
     
    Make sure you add a check for your email address or something so you can add the Power App to your SharePoint Page without it redirecting you. 
     
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a Like.
     
    Thanks
    -Mark

    ​

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard