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
PowerApps Staff CarlosFigueira
PowerApps 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!

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.
PowerApps Staff CarlosFigueira
PowerApps 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!

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!

PowerApps Staff CarlosFigueira
PowerApps 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
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 276 members 4,698 guests
Recent signins:
Please welcome our newest community members: