cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
afoti
Level: Powered On

NewForm and Gallery.Selected Value

Hi, I have a form set up that is dedicated to creating new items called 'EntryForm'.It is set in NewForm mode.

 

When a submission is made through it (i.e. a new item created) I wanted it to progress to another form which is set to edit mode. The issue is this form is picking up the item from the Gallery screen via the '.Selected' property and not showing the EditForm for the newly-created item.

 

Is there a way to change this .Selected property to a new item when it is created in the EntryForm so it points to the newly-created item by default?

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: NewForm and Gallery.Selected Value

An easier way to do this instead of updating the selection in the gallery (it may not work for data sources with many elements) is to decouple the form from the gallery selection. The idea is to "pass" the gallery selection when navigating from the browse screen to the detail / edit screens.

 

The blog post at https://blogs.msdn.microsoft.com/carlosfigueira/2017/10/04/decouplingbrowsegalleryfromforms/ shows the steps that you need to take to decouple the form from the gallery. Hope this helps!

View solution in original post

6 REPLIES 6
Community Support Team
Community Support Team

Re: NewForm and Gallery.Selected Value

Hi afoti,

 

I assume that you are using an EditForm control on your side. I think that we could use an EditForm to either edit existing items or create new items.


You may have a DisplayForm, then navigate from the DisplayForm to the EditForm, the function you could use here is: EditForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None)


You may have a Gallery and use the NewForm function to create new items, the function you could use here is: NewForm(EditForm1);Navigate(EditScreen1, ScreenTransition.None)


You could auto-generate an app from data to know more about these functions.


Please also check this documentation:
https://powerapps.microsoft.com/en-us/tutorials/function-form/

 

I also try to set an edit form’s item property to EditForm1.LastSubmit. When you navigate from the NewForm to EditForm, the item you last submitted will be displayed on the EditForm.


Please take a try with it.

 

Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: NewForm and Gallery.Selected Value

An easier way to do this instead of updating the selection in the gallery (it may not work for data sources with many elements) is to decouple the form from the gallery selection. The idea is to "pass" the gallery selection when navigating from the browse screen to the detail / edit screens.

 

The blog post at https://blogs.msdn.microsoft.com/carlosfigueira/2017/10/04/decouplingbrowsegalleryfromforms/ shows the steps that you need to take to decouple the form from the gallery. Hope this helps!

View solution in original post

Highlighted
afoti
Level: Powered On

Re: NewForm and Gallery.Selected Value

Thanks Carlos, exactly what I'm looking for. Cheers.

JeremyDIV
Level: Powered On

Re: NewForm and Gallery.Selected Value

Dead Link!

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: NewForm and Gallery.Selected Value

Updated the link inline, thanks for letting me know!

MitchC3
Level: Powered On

Re: NewForm and Gallery.Selected Value

Any other suggestions as I guess my gallery's Item property has too many elements I for this to work?

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,141)