cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft russrimm
Microsoft

SubmitForm and stay on the submitted item

Hi all,

I have a form connected to a SQL datasource, 1 gallery that you select an grouped list of items and a 2nd gallery that is displaying the items that are associated with the selected item in the first gallery.

When I hit Submit on the form, it's auto-selecting the first item in the first gallery and displaying it instead of staying on the selected item that just got submitted.

I tried setting a global variable to the record selected in the first gallery, but the property I would need to have it re-select isn't an option in the Gallery1.Selected.(properties), I presume because i'm doing a groupby?

On my OnSuccess of the form, I have it set to "false".  How do I make Gallery1 stay on the selected item when the form is submitted?

Thanks!  

4 REPLIES 4
Dual Super User
Dual Super User

Re: SubmitForm and stay on the submitted item

Hi @russrimm 

 

When you navigate to the screen which shows the form (

The Item property of the form would probably be Gallery.Selected

OnVisible of the screen which has the form , do Set(varForm,Gallery.Selected) and replace the Item property with varForm

 

Next once form is submitted, OnSuccess property of the form do

ViewForm(formname) - or EditForm(formname)

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Microsoft russrimm
Microsoft

Re: SubmitForm and stay on the submitted item


@RezaDorrani wrote:

Hi @russrimm 

 

When you navigate to the screen which shows the form (

The Item property of the form would probably be Gallery.Selected

OnVisible of the screen which has the form , do Set(varForm,Gallery.Selected) and replace the Item property with varForm

 

Next once form is submitted, OnSuccess property of the form do

ViewForm(formname) - or EditForm(formname)

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.


Hi @RezaDorrani thank you for that.  In my case, I have both galleries and the form on the same screen.  Gallery1 is showing a groupby of the datasource to show only a list of people's names, and Gallery2 is showing a Filter of the datasource, using the name of the person selected in Gallery1 for the filter.  If I change the Item of the gallery to a variable, I get in a bit of a catch 22 as I can't use OnVisible because it's all on one screen.  Is my only option to split it into two screens so I can leverage OnVisible for setting the variable?

Thanks!

Dual Super User
Dual Super User

Re: SubmitForm and stay on the submitted item

Hi @russrimm 

 

You can also trigger the setting of that variable when the item is selected in the gallery

OnSelect of gallery item - Set the variable

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Microsoft russrimm
Microsoft

Re: SubmitForm and stay on the submitted item

Hi @RezaDorrani, thanks again, that got me further, and I think I just realized what my primary issue is.  The gallery I select that controls the form is filtered based on a specific value in that form.  When I change that value, it also updates my collection populating the gallery which removes the record from the collection.  Therefore, there's no way for that item to remain selected because it's gone out of the collection, so it's automatically selecting the first record because the last selected isn't available anymore.  I'm wondering now if there's a way to automatically select the next record in the gallery instead?

Thanks

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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