{"id":1073,"date":"2018-04-03T15:19:01","date_gmt":"2018-04-03T21:19:01","guid":{"rendered":"http:\/\/www.idubbs.com\/blog\/?p=1073"},"modified":"2018-04-03T15:19:01","modified_gmt":"2018-04-03T21:19:01","slug":"powerapps-links-to-apps-and-screens","status":"publish","type":"post","link":"https:\/\/www.idubbs.com\/blog\/2018\/powerapps-links-to-apps-and-screens\/","title":{"rendered":"PowerApps&ndash;Links to Apps and Screens"},"content":{"rendered":"<p>Last week at SharePoint Fest DC (#SPFestDC) I had a question in one of my sessions that I didn\u2019t know the answer to at the time and wanted to follow up on: <br \/>\u201cCan you link to a specific screen on a PowerApp?\u201d<\/p>\n<p>Doing a little search I quickly found the answer <a href=\"https:\/\/powerusers.microsoft.com\/t5\/General-Discussion\/Link-to-a-specific-screen\/td-p\/56131\" target=\"_blank\">HERE<\/a> in the General Discussion Community Boards. <\/p>\n<h3>Background: Link Basics<\/h3>\n<p>There are a number of ways to get access to a PowerApp via a URL link. They all by default will land the user on the default start screen for the app. <\/p>\n<p>From SharePoint, PowerApps apps created from and linked to a list are displayed in the Views dropdown. <br \/><a href=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image_thumb.png\" width=\"149\" height=\"185\"><\/a><\/p>\n<p>These links take you to an app \u2018launch screen\u2019 for PowerApps. Where you need to click again to get to the app. <br \/><a href=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image_thumb-1.png\" width=\"139\" height=\"182\"><\/a><\/p>\n<p>Clicking on \u2018Open\u2019 launches the PowerApp in the browser window on a new tab. <\/p>\n<p>Note: ONLY apps created from the SharePoint interface will show up in the views drop down. If you create other apps starting from the PowerApps interface \u2013 either from blank, or from data \u2013 they will NOT show up in the views drop down for the list even if they use the list as the data source for the app. <\/p>\n<p>From PowerApps, when clicking on the app \u2018info\u2019 icon you access the app detail page and can get access to a URL directly to your app. <br \/><a href=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; margin: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image_thumb-2.png\" width=\"153\" height=\"224\"><\/a><br \/>Using the 3rd icon\u2026 the \u2019i&#8217;. <\/p>\n<p><a href=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/PowerAppDetailsPage.png\"><img loading=\"lazy\" decoding=\"async\" title=\"PowerAppDetailsPage\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"PowerAppDetailsPage\" src=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/PowerAppDetailsPage_thumb.png\" width=\"392\" height=\"285\"><\/a><\/p>\n<p>So, the link looks something like this: <br \/>https:\/\/web.powerapps.com\/apps\/[GUID]<\/p>\n<p>This link opens the PowerApps app directly in the browser \u2013 so something you could add to a SharePoint page if you wanted users to have more direct access to the app from anywhere. <br \/>Note: If you provide a direct link consider who has access to the app (Sharing) and the data (SharePoint list, or other data source). Providing a link to someone that doesn\u2019t have the access they need could be irritating for users. <\/p>\n<h3>Link to Screen<\/h3>\n<p>The concept seems simple. <\/p>\n<ol>\n<li>Add a parameter to the app URL<\/li>\n<li>Add logic in the app to grab the parameter value and determine which screen to navigate to<\/li>\n<\/ol>\n<p>Using the web.powerapps.com link shown above I added a new menu item to my SharePoint menu:<br \/><a href=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; margin: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image_thumb-3.png\" width=\"238\" height=\"244\"><\/a><br \/>This links directly to the app and the default screen.<\/p>\n<p>Then added the parameter to the string for a second link: <br \/><a href=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image-4.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; margin: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.idubbs.com\/blog\/wp-content\/uploads\/2018\/04\/image_thumb-4.png\" width=\"240\" height=\"244\"><\/a><br \/>This links to the specific screen (after the formula below is also added)<\/p>\n<p>In the PowerApp, set the OnStart formula to something like the following: <\/p>\n<p>Set(startScreen,Param(&#8220;screenid&#8221;));If(startScreen=&#8221;2&#8243;, Navigate(BrowseRankingScreen,ScreenTransition.None),Navigate(BrowseScreen1,ScreenTransition.None))<\/p>\n<p>This is essentially two lines of \u2018code\u2019: <\/p>\n<ol>\n<li>Set(startScreen,Param(&#8220;screenid&#8221;));<br \/>Param grabs the parameter passed in by the URL string and sets it to the \u2018startScreen\u2019 variable within the PowerApp <\/li>\n<li>If(startScreen=&#8221;2&#8243;, Navigate(BrowseRankingScreen,ScreenTransition.None),Navigate(BrowseScreen1,ScreenTransition.None))<br \/>This references the \u2018startScreen\u2019 parameter to determine which screen should be displayed. This particular example is \u2018one or the other\u2019 \u2013 defaulting to the normal start screen if a parameter is not passed in. You could use a variation of the formula to essentially do a \u2018switch\u2019 or multiple \u2018ifs\u2019 if you wanted options for a bunch of different start screens. <\/li>\n<\/ol>\n<p>Once the pieces are all in place, you have the option of linking directly to a specific page in a PowerApp app from SharePoint or anywhere else an HTML\/URL link is allowed. <\/p>\n<h3>Notes: <\/h3>\n<ul>\n<li>Be sure that any screen you are choosing to start from will work when directly navigating to it. Depending on how the app was built the screen may normally require data or settings from other screens to work correctly \u2013 as when a record selection has been made before coming to a detail screen. <\/li>\n<li>There were references to the parameter only working with and\/or forcing the parameter name to lower case. I have not verified if this is still the case. <\/li>\n<li>There were also reports of caching issues so you may need to try a few times to get the links working properly. Kind of irritating, but it eventually worked. <\/li>\n<li>Be aware of the parameter type\/value being used. In the example above we used: ?screenid=2 which actually passed in a *string* value of \u201c2\u201d. This required the formula to use the string version as well: startScreen=\u201d2\u201d (correct) instead of startScreen=2 (incorrect). Easy mistake to make and the difference between your formula working or not. If you choose to pass in a non-numeric string it might make readability better down the road: ?screen=thisscreen.&nbsp; <\/li>\n<\/ul>\n<h3>References<\/h3>\n<ul>\n<li><a href=\"https:\/\/powerusers.microsoft.com\/\" target=\"_blank\">Power Users Community<\/a><\/li>\n<li><a href=\"https:\/\/powerusers.microsoft.com\/t5\/General-Discussion\/Link-to-a-specific-screen\/td-p\/56131\" target=\"_blank\">The specific post<\/a> mentioned above<\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-param\" target=\"_blank\">Download, Launch, and Param functions<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Last week at SharePoint Fest DC (#SPFestDC) I had a question in one of my sessions that I didn\u2019t know the answer to at the time and wanted to follow [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[96,21],"tags":[129,151,150,152],"class_list":["post-1073","post","type-post","status-publish","format-standard","hentry","category-powerapps","category-sharepoint-online","tag-links","tag-param","tag-parameters","tag-screens"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgWQ1-hj","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/posts\/1073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/comments?post=1073"}],"version-history":[{"count":1,"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/posts\/1073\/revisions"}],"predecessor-version":[{"id":1074,"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/posts\/1073\/revisions\/1074"}],"wp:attachment":[{"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/media?parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/categories?post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.idubbs.com\/blog\/wp-json\/wp\/v2\/tags?post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}