cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Super User
Super User

Redirect users to a standalone App from a Power App Sharepoint customized list form, and pass the item id

I have a standalone Power app which have deep linking implemented, so if the url contain an ID the Power Apps form will load in Edit mode while if the url does not contain ID it will load the form with default value.

And i have customized the SharePoint forms for a custom list using Power Apps. the idea is that if the user clicks on the New button inside the SharePoint list view >> to redirect the user to the standalone app, while if the user click on the Edit button inside the SharePoint list view >>  to catch the item id inside the customized form and redirect the user to the standalone app with the item id passed in the parameter string.. so how i can implement passing the id from the power app customized form to the standalone app?

 

here is how i am doing the redirect inside the customized power app form, when the user click on the edit form:-

 

t.png

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerRanger
Super User
Super User

@johnjohn123 

For OnEdit use a formular like this

 

Launch("https://www.google.de",{selectedItem:SharePointIntegration.SelectedListItemID,mode:"edit"},LaunchTarget.New);
RequestHide()

 

For OnNew use this formular:

 

Launch("https://www.google.de",{mode:"new"},LaunchTarget.New);
RequestHide()

 

 

This will add a QueryString parameter "selectedItem" and "mode" to the url you are providing. The URL will look like this then if you e.g. select the item with ID 2 and click edit in sharepoint

 

 

https://www.google.de/?selectedItem=2&mode=edit

 

 

If you would click New in sharepoint the url would look like this:

https://www.google.de/?mode=new

 

In your standalone app in the StartScreen property add this:

 

If(
    Param("mode") = "new",
    Screen1,
    Screen2
)

 

 

To know which Item to display if mode = edit use something Like this:

 

LookUp(
    SampleList,
    ID = Value(Param("selectedItem"))
)

 

 

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.




​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

2 REPLIES 2
PowerRanger
Super User
Super User

@johnjohn123 

For OnEdit use a formular like this

 

Launch("https://www.google.de",{selectedItem:SharePointIntegration.SelectedListItemID,mode:"edit"},LaunchTarget.New);
RequestHide()

 

For OnNew use this formular:

 

Launch("https://www.google.de",{mode:"new"},LaunchTarget.New);
RequestHide()

 

 

This will add a QueryString parameter "selectedItem" and "mode" to the url you are providing. The URL will look like this then if you e.g. select the item with ID 2 and click edit in sharepoint

 

 

https://www.google.de/?selectedItem=2&mode=edit

 

 

If you would click New in sharepoint the url would look like this:

https://www.google.de/?mode=new

 

In your standalone app in the StartScreen property add this:

 

If(
    Param("mode") = "new",
    Screen1,
    Screen2
)

 

 

To know which Item to display if mode = edit use something Like this:

 

LookUp(
    SampleList,
    ID = Value(Param("selectedItem"))
)

 

 

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.




​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.
johnjohn123
Super User
Super User

@PowerRanger  will try you r approach and let you know thanks a lot for your help.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,709)