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

PowerApps Edit Icon Navigation

Hello All, 

 

I am using the edit or pencil icon within PowerApps on my Detailscreen1 to then enable the user to go that item and edit. However whilst when clicking on the icon you navigate to the EditScreen1 it does not display that prior selected item, only blank fields.

 

Can you help to advise what the 'OnSelect' property should be for this icon, currently set as follows

EditForm(EditForm1);Navigate(EditScreen1, ScreenTransition.Fade)

The 'Item' property on EditForm1 is currently as follows as I am also using this to enable a hyperlink to be used within the SharePoint list to take the user direct to the EditScreen1 for their selected item and suspect this could also be part of the issue?

If(!IsBlank(Param("ID")), LookUp('Credit Note Approval Request',ID = Value(Param("ID"))))

With the 'Onvisible' on the EditScreen also set as follows

If(!IsBlank(Param("ID")), EditForm(EditForm1), NewForm(EditForm1))

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Gazsim ,

OK - Plan B which will work (but you should not have to do this), you need to have an Intro screen (you could simply have a Continue button on it and your company logo). OnVisible

If(
   !IsBlank(Param("ID")), 
   Set(
      gblID,
      Value(Param("ID"))
   )
)

On the Continue button

If(
  gblID > 0,
  Navigate(YourEditScreen),
  Navigate(YourGalleryScreen)
) 

OnSelect of the Gallery

Set(gblID, ThisItem.ID)

Item of the Form

LookUp(
   ListName,
   ID=gblID
)

If you want to get a bit smarter, you could start a timer at Screen OnVisible and put the button code OnTimerEnd.

 

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.

Visit my blog Practical Power Apps

View solution in original post

15 REPLIES 15
WarrenBelz
Super User
Super User

Hi @Gazsim ,

That will only work if you have opened the app with an incoming parameter (which you cannot do in Design mode). As a result, the Edit Form will never open (you will get a new form) unless you launch it with a deep link parameter containing the ID number you want to open.

 

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.

Visit my blog Practical Power Apps

 

 

Hi @WarrenBelz 

 

Thanks for the reply. So what would be the best solution? I require the ability for the user to be able to edit the item from the SP list directly in the PowerApp but also to be able to edit any selected item from the browse screen within the app if using that directly.


Thanks

@Gazsim <

When you refer to browse screen, is this your gallery to select the relevant item? There are two distinct issues here - firstly from the gallery you would normally do something like

Set(gblID,ThisItem.ID);
EditForm(EditForm1);
Navigate(EditScreen1)

and the Item of your Form would be

LookUp(
   ListName,
   ID=gblID
)

but you have thrown in an incoming parameter option, which if the app was launched with one, you would not go to the Gallery, but direct to the Edit screen - what exactly are you trying to do with this?

 

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.

Visit my blog Practical Power Apps

 

Hi @WarrenBelz 

 

Yes sorry my browse screen is my gallery . 😊

I basically at the moment have the icon on the gallery set to go to the detail screen which is non editable. I then wanted to set a further icon on this screen to go to the edit screen.

 

At the same time I was also trying to set the deep link on SP to go directly to the edit screen of that item but maybe I am now over complicating this? 

Thanks

Hi @Gazsim ,

In conjunction with the previous code I supplied, you could have on the OnVisible of the edit screen

If(
   !IsBlank(Param("ID")),
   Set(gblID,Value(Param("ID"))
)

You can also put in StartScreen

If(
   !IsBlank(Param("ID"),
   EditScreen1,
   BrowseScreen1
)

 and navigate directly there

 

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.

Visit my blog Practical Power Apps

WarrenBelz
Super User
Super User

Hi @Gazsim ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Visit my blog Practical Power Apps

Hi @WarrenBelz 

 

Apologies for not getting back sooner - other work took over yesterday.

 

So using the code you suggested per below I can open the item from the list in SP but then when I then navigate to the browse gallery and select a different item, the original item I selected from SP remains.

 

In addition I also now have a link in an excel document to enable the user to add / open an item which with this setup navigates directly to the browse gallery instead of the item concerned as it had done. This was setup to auto populate the fields from excel into the PowerApp directly.

 

=IFERROR(HYPERLINK("https://apps.powerapps.com/play/mypowerappid?tenantId=c5d1e823-e2b8-46bf-92ff-84f54313e0a5&ID="&VLOOKUP(A18&G18,CASS_1,2,0),"Open"),HYPERLINK("https://apps.powerapps.com/play/mypoweradppid?sref="&A18&"&mawb="&B18&"&branch="&C18&"&dest="&D18&"&gro="&E18&"&cha="&F18&"&ct="&G18&"&ex="&I18&"&act="&J18&"&dif="&K18,"Add"))

 

Browse Gallery, On Select

Set(gblID,ThisItem.ID);EditForm(EditForm1);Navigate(EditScreen1)

Edit Screen, OnVisible

If(!IsBlank(Param("ID")), Set(gblID,Value(Param("ID"))))

Edit Form, Item

LookUp(CASS, ID=gblID)

StartScreen

If(!IsBlank(Param("ID")), EditScreen1, BrowseScreen1)

 

Apologies for all the confusion, I am sure I am over complicating this with my little knowledge!

 

Thanks

 

 

HI @Gazsim ,

And here is the conundrum of thew new StartScreen function. You can do either (use the incoming deep-linked parameter or the gallery selected item if no parameter), but not both easily, as you now cannot set OnStart parameters that can be used for initial navigation (hence the screen OnVisible).

Another thought - delete the OnVisible code on the form screen and instead OnSelect of the Gallery

Set(galSelected,true);
EditForm(EditForm1);
Navigate(EditScreen1)

Your Form Item

LookUp(
   CASS, 
   ID = 
   If(
      galSelected,
      GalleryName.Selected.ID,
      Value(Param("ID"))
   )
)

 

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.

Visit my blog Practical Power Apps

 

Hi @WarrenBelz 

 

Thought that version almost had it :-). When navigating in the app if you open from play without the URL in excel then all was fine and when selecting from the browse gallery it took that item to the edit screen.

However I then tried the URL on the excel file - this then started the app in the browse gallery rather than the edit screen with all the details completed. If you then selected ANY item in the browse gallery it would take you to the edit screen BUT with the details of the shipment that had been selected from the URL in excel and not that item from the gallery.

 

Hope that makes sense, 

Thanks!

 

 

Helpful resources

Announcements
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 Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (6,085)