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

Open PowerApps from a URL - then go to edit screen and filter by a given record

Hello,
We would like to create a URL which will:
(1) Open Power Apps
(2) Go to the Edit Screen (we currently have 3 screens, Browse, Detail and Edit)
(3) Filter by a given record - i.e. MyFieldName=24

i.e.
https://web.powerapps.com/apps/<MyAppID>?MyFieldName=24

But, cannot get this to work. Tried looking at this example but it did not work.
https://powerapps.microsoft.com/en-us/blog/powerapps-deep-linking/

Appreciate any assistance you can provide,
Dan

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @lesotho_kid ,

Your deep link code looks right

https://web.powerapps.com/apps/<MyAppID>?MyFieldName=24

At App OnStart, do this

If(
   !IsBlank(Param("MyFieldName")),
   Set(
      vID,
      Value(Param("MyFieldName"))
   );
   Navigate(YourEditScreen)
)

On the Item of your Edit Form

Lookup(
   YourListName,
   ID=vID
)

If you also navigate to this record by selecting it in a gallery, put this on the Gallery OnSelect

Set(vID,ThisItem.ID);
Navigate(YourScreenName)

 

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

9 REPLIES 9
WarrenBelz
Super User
Super User

Hi @lesotho_kid ,

Your deep link code looks right

https://web.powerapps.com/apps/<MyAppID>?MyFieldName=24

At App OnStart, do this

If(
   !IsBlank(Param("MyFieldName")),
   Set(
      vID,
      Value(Param("MyFieldName"))
   );
   Navigate(YourEditScreen)
)

On the Item of your Edit Form

Lookup(
   YourListName,
   ID=vID
)

If you also navigate to this record by selecting it in a gallery, put this on the Gallery OnSelect

Set(vID,ThisItem.ID);
Navigate(YourScreenName)

 

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

v-xida-msft
Community Support
Community Support

Hi @lesotho_kid ,

Could you please share a bit more about your scenario?

Do you want to edit a specific record in your canvas app via clicking the embedded App URL Link?

 

The user @Kumar9024021 has faced similar needs with you, please check my response within the following thread:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Include-EditForm-link-for-particular-item-in...

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/Embedded-link-to-a-Sharepoint-List-item-in-P...

 

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-xida-msft for the additional links.

@lesotho_kid if you try the code I supplied, I believe it will work for you - please let me know.

Happy to help further.

Thanks @WarrenBelz  and @v-xida-msft 

Solved it!

 

Have a good night,

Dan

Hi @WarrenBelz and @v-xida-msft 

 

One update on this - working properly for the filter but we also have an "add new record" option.  Not sure how to adjust the Item of edit form.  Trying to do something like If FormMode.New - do something - but not sure how to tell it to go into new form mode (and use all defaults) as opposed to using the parameter as filter and edit the form.

 

Thanks!

Dan

 

 

On the Item of your Edit Form

Lookup(
   YourListName,
   ID=vID
)

 

@lesotho_kid ,

Are you asking to put another parameter into the URL for a new form?

You would do something list this

https://web.powerapps.com/apps/<MyAppID>?MyFieldName=24&NewForm=1

then at App OnStart - you can do this without nesting, but try the below.

If(
   !IsBlank(Param("NewForm")),
   NewForm(YourNewFormName);
   Navigate(YourNewScreenName),
   If(
      !IsBlank(Param("MyFieldName")),
      Set(
         vID,
         Value(Param("MyFieldName"))
      );
      Navigate(YourEditScreen)
   )
)

 

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.

Thanks @WarrenBelz 

I would prefer to not use another parameter if I don't have to. 

I have only one data entry form called 'MyEditForm'.

When I access via URL or from my browse screen I'd like to pass in the ID and edit an existing record.  That works.

But, on my browse screen I also have an 'Add New' button which, when I click it, I'd like to open the same 'MyEditForm' - this time to create a new record. 

The add button code is:

 
NewForm(MyEditForm);Navigate(MyEditForm, ScreenTransition.None)

 

So, use one form to either edit an existing record or add a new record.  Hope this is possible and I don't have to create an edit screen and an add new screen.  The screen has many fields.

Thanks for all of your help - sincerely appreciated.

Dan

Hi @lesotho_kid ,

Yes that is certainly possible - mine was only an example of the syntax required with a different screen.

Thanks again @WarrenBelz - that worked.  Sorry about all of the questions.  Sincerely appreciate your help.

 

Have a good weekend,
Dan

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (974)