web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / On select Command Sequ...
Power Apps
Answered

On select Command Sequence

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I was wondering if there is a way to submit a form before the PowerApps registers an on select command from a separate gallery.

 

For example I have this screen here.

On the left is a gallery which has a list of base questions which relate to a particular customer 

On the right is a form which changes based on the question that is selected.

 

TrinalRogue_0-1644423534983.png

 

If I make a change on the right then select a different question on the left; the changes I made on the right would disappear if you don't click submit changes. I can already see this being an issue with the end users for this - complaining that they spent a minute or so filling out the details then it didn't submit those changes for the particular base question because they forgot to click submit changes (despite the big button saying so at the top).

 

I was wondering if it is possible to have the submit form command go before the PowerApps registers a change in selected item on the left and changes the form contents on the right?

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Perform a SubmitForm on the form in your Gallery.  You will want to utilize a snapshot variable to contain the record for the form.

    So, for example, in the OnSelect for your Gallery, you would do the following:

     

    If(yourForm.Unsaved, 
     Set(glbNextRecord, ThisItem);
     SubmitForm(yourForm),
    
     Set(glbCurrentRecord, ThisItem)
    )

     

    Then in your OnSuccess action of the form, the following formula:

     

    Set(glbCurrentRecord, glbNextRecord)

     

    And the Item property of your Form: glbCurrentRecord

     

    Without knowing a couple other details, you might need to make some adjustments in the flow of your process, but the above is the basic concept.

     

    I hope this is helpful for you.

     

    EDIT: Slight change in the OnSelect formula made.

  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @Anonymous 

     

    Whats your code on the OnSelect of the gallery? So what happens when you select a different question.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard