cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Email Link takes the user to a specific screen

Hello everyone,

 

I have been trying to get this functionality to work but I am having issues:

 

Data Source: SharePoint List. I currently have multiple screens in my app. All the below screens are built as a separate Canvas App and not through SharePoint Power Apps option.

 

Filter Screen: Has drop downs, gallery with some details. When a user clicks on an item in the gallery, it takes them to the next page which is 'Display screen' - which provides additional details of the item based on the selected item in the gallery. This Display page has an Edit Icon and will take them to the 'Edit Screen' which will look just like the Display Screen but has Edit capabilities and Save. The users will be able to go tp the incident that they want using this process. This has been working great so far.

 

Scenario: I have created a Flow using Power Automate/Microsoft Flow to send an automated email with a URL (PowerApplink+ID). When the user clicks on the link, they should be taken directly to the 'Display Screen' with the details of the new item created, just like how the user is able to go to the 'Display Screen' by selecting an item in the gallery.

 

I have tried creating duplicating the display screen and changing the item, but doesn't seem to work. Any ideas?

19 REPLIES 19
Highlighted

Hi @BB9 ,

Just got your last message - that is precisely what I do and it is not difficult.

The key is the common selection method of the required record on the screen containing this form. As you are sending the ID in the URL, this is done as per the specs below. Strangely, I actually have the same screen name as you and a different Reference.

So firstly at App OnStart

If(
   !IsBlank(Param("ItemID")),
   Set(
         vID,
         Value(
            Param("ItemID")
         )
      );             
      Navigate(DisplayScreen,ScreenTransition.Cover),   //This has the target record on it
      Navigate(YourGalleryScreen,ScreenTransition.Cover); //This has a gallery of records on it    
   )
)

This will put the ID number you want into the numeric variable vID and navigate straight to the DisplayScreen (or to the gallery screen if there in no ItemID parameter in the URL that opened the app).

Now the Item of the form displaying the record can be

LookUp(MyListName,ID=vID)

and lastly, on the OnSelect of your gallery that normally selects the item

Set(vID,ThisItem.ID);
Navigate(DisplayScreen,Fade)

So it will also display the required record by the same means.

Happy to elaborate further if required.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Highlighted

Thank you @WarrenBelz for the additional information. That's exactly how I had. I went ahead and replaced my code with your snipper but it still works only while on the App. When I am clicking on the URL, it is taking them to the filterpage. I have added labels to see if the vID from the URL is getting set to vID. It is showing up as blank on both screens.

Highlighted

Hi @BB9 ,

What is your Launch URL? - I think the issue is there?

Highlighted

Hi @BB9 ,

You have blanked most of it out, but by the length of it, you have the ?tenantid bit in as well. If so (you don't actually need this), the bit before ItemID should be &ItemID= . . .

Highlighted

https://apps.powerapps.com/play/*******************?tenantId=**********&ItemID=29 - This is the link from the email generated by Microsoft Flow.

 

I also has a welcome screen with two buttons - one directly takes them to the filter page, one will let them create a new item.

 

On App Start, previously, I set it to the Welcome Screen, but I have replaced it with the code similar to yours at least to get this email link to work. Now my App Start - Looks like:

Collection1, Collecton2 --- Collection5; 

If(
!IsBlank(Param("RecordID")),
Set(
vID,
Value(
Param("RecordID")
)
);
Navigate(DisplayScreen,ScreenTransition.Cover), //This has the target record on it
Navigate(FilterPage,ScreenTransition.Cover); //This has a gallery of records on it
)
 
When I run the app normally, my URL will look like this:

 

Highlighted

Hi @BB9 ,

As per my last amended post, you need to refer to your parameter name

 

If(
   !IsBlank(
      Param("ItemID")
   ),
   Set(
      vID,
      Value(
         Param("ItemID")
      )
    );
   Navigate(DisplayScreen,ScreenTransition.Cover), //This has the target record on it
   Navigate(FilterPage,ScreenTransition.Cover); //This has a gallery of records on it
)

 

 

Highlighted

Ugghhh, how did I make this silly mistake. I changed my variables to your variables and forgot to update my variable name in Flow. Looks like it is working now. Thank you so much for your help.

 

I had similar logic before but for some reason I am still not able to figure out what I did wrong before, but after I changed it similar to yours, it is working perfectly. Although this looks simple, I spent quite some time changing the logics/galleries etc. Thanks again.

 

One more question (irrelavant to this post though):

I have two use cases. One user directly using the App. Second users coming through the email link.

Now that we have changed the On Start navigate screen, every time I open the app it takes them directly to the Filter screen. Is there a way to have a conditional logic to have the welcome screeen loading when the user open the app and take them to the display screen when they click the link?

Highlighted

Hi @BB9 ,

You can have more than one parameter in one link, or a different parameter in the other email link.

So if you had in the other Link .......&welcome=1, you would test for Param("welcome") - you can set it to whatever your want (1 is an example), but if it was not blank - you could have something like

If(
   !IsBlank(
      Param("ItemID")
   ),
   Set(
      vID,
      Value(
         Param("ItemID")
      )
    );
   Navigate(DisplayScreen,ScreenTransition.Cover),
   If(
   !IsBlank(
      Param("Welcome")
   ),
   Navigate(WelcomeScreen,ScreenTransition.Cover),
   Navigate(FilterPage,ScreenTransition.Cover)
)

 

Highlighted

Hi @WarrenBelz Hope you are doing well.

 

I added one more edit screen so that when user wants to edit an item from the filter screen, the user will be taken to a screen where the item will display the data for the particular selected item in the gallery - gallery.selected.

 

But when the user wants to edit the item from the email link where I passed it as a parameter, how to pass the same id to a different screen from the display screen? The user clicks the link which has the ItemID appended to the URL so it takes the user directly to a display screen, how do I make the user edit the same item so the user can edit? So basically what should be the condition for the "item" for the edit screen? I tried a couple but didn't work. Thanks for your help!

Highlighted
Super User III
Super User III

Hi @BB9 ,

I generally always use a variable for the current item ID, so I can use it on the Item of any form with the syntax

LookUp(
   ListName,
   ID=vID
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,338)