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 / How to prevent new ite...
Power Apps
Answered

How to prevent new item form from submitting twice?

(0) ShareShare
ReportReport
Posted on by 873

I have a button to submit a form (Form1) for a new item in my new item screen.  I copyed all the logic from the budget app template.

 

The "Save" button has this property:

OnSelect = SubmitForm(Form1)

 

Form1 has this property:

OnSuccess = Navigate(Landing,ScreenTransition.Fade);ResetForm(Form1)

 

However there is no indication that the button has been successfully pressed, so that I pressed it twice and created two new identical records in my data source.

 

Does any one have a good idea how to prevent submitting a new item form twice?

 

Maybe you disable the button as soon as it is pressed?  Is there a correct way to do this?

Categories:
I have the same question (0)
  • Verified answer
    Brian Dang Profile Picture
    3,976 on at

    In version 2.0.412, PG added a AutoDisableOnSelect property for buttons. If you set it to true, the button will grey out if it is selected.

     

    If you are looking for a manual solution to be sure the button gets disabled, try this:

    UpdateContext({load: true});
    
    [your Patch, Update, UpdateIf, SubmitForm code here];
    
    UpdateContext({load: false})

    Set the Disabled property of the Button to the variable "load." The load variable will turn on upon the click of the button. It will turn off once writing to your datasource is complete.

     

    If you want to get real fancy, also add an image box that covers your screen. Set its Image property to an animated GIF and its Visible property to the load variable. The GIF will block everything until the operation is complete. If you get impatient, then set the OnSelect property of the GIF to:

    UpdateContext({load: false})

     

     

  • hpkeong Profile Picture
    2,944 on at

    Hi

     

    In fact, this was discussed earlier on how to prevent NOT ONLY pressing twice on SAVE button (wheere now it has included AutoDisableOnSelect, set to true).

    Dang used something to cover the whole page, and I used to set all items (press Ctrl-A) and set Disabled: XX, and when pressing save, UpdateContext(XX: true). That will prevent from changing any INPUT while saving (because sometimew it will take a little longer due to slpw internet connection).

     

    Just sharing.

     

  • Kellboy22 Profile Picture
    2 on at

    Hello guys this is very helpful but i was thinking of the possibility of limiting the entry for each office 365 user once per day. Any ideas?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard