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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to stop user to su...
Power Apps
Answered

How to stop user to submit form if nothing is been edited

(0) ShareShare
ReportReport
Posted on by 2

I am working on Power app for teams.

 

I have Tick mark icon under which on select property I am using the below code:

SubmitForm(SupportEditForm);ResetForm(SupportEditForm)
 
Some time user click even if he has done no changes on the edit form.
 
I want the code not to run , if there is no edit been done OR no changes has been done  on the edit form.
It should only only run if the form is new or available data has been edited
 
Please guide what additional collection of code to be done to achieve this.
 
Categories:
I have the same question (0)
  • ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    Hi @MIA27 , Great! 

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • MIA27 Profile Picture
    2 on at

    Thank you at last.... It worked. Successfully.

    As the Form1 DefaultMode = FormMode.View, So wanted any time user click, what ever the action to happen must be pushed to view mode. so if need they will click edit button again.

     

    Below code worked successfully, tested several time it working 100% perfect. If edited saves and reset, if not edited it produces notify and reset.

     

    Set(gblvar_Record, Gallery1.Selected);
    If(
     Or(
     gblvar_Record.SerialNo <> DataCardValue1.Value, 
     gblvar_Record.JobAmt <> Value(DataCardValue2.Text), 
     gblvar_Record.LineNo <> Value(DataCardValue3.Text), 
     gblvar_Record.Model <> DataCardValue4.Value 
     ),
    SubmitForm(Form1);
    ResetForm(Form1),
    ResetForm(Form1);Notify("No Save Rquired as no Edit done",NotificationType.Information,2000)
    )

     

  • MIA27 Profile Picture
    2 on at

    while google found so many method, all complicated, found an below image.

    Is it possible to adopt this method of unsaved. 

    By adding a label.

    then the ticket code to run 

    IF label.text =  ... Then

    submitform,

    notify)

     

     

    Please guide, just an idea

    MIA27_0-1710662575235.png

     

  • Verified answer
    ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    Hi @MIA27 , we are already doing that on the OnSelect of Gallery. You can try this 

    Set(gblvar_Record, GalleryName.Selected);
    If(
     Or(
     gblvar_Record.SerialNo <> DataCardValue1.Value, 
     gblvar_Record.JobAmt <> Value(DataCardValue2.Text), 
     gblvar_Record.LineNo <> Value(DataCardValue3.Text), 
     gblvar_Record.Model <> DataCardValue4.Value 
     ),
    SubmitForm(Form1);
    ResetForm(Form1),
    Notify("No Save Rquired as no Edit done",NotificationType.Information,2000)
    )

    This is pretty straight forward option. As I cant see your screen and not sure how your code is linked, it is difficult for me.

     

    The suggestion that I gave is based on best practice.

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • MIA27 Profile Picture
    2 on at

    I checked all the labels in the gallery on select is set  Select(Parent)

     

    What is making me worry - the unsure of the working of code, that 3 times worked, 1 time failed, some time worked and some time fails.

     

    Is there any way that after running the Tick button code, every time it will reload the selected gallery value to gblvar_Record. I mean we can some add some  line of code along with other code of the Tickmark icon code, so once user click, what ever the result, it will reload the var.

     

    please guide

     

  • ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    Hi @MIA27 , Make sure to set the OnSelect property of all controls within left side gallery to Select(Parent).

    ANB_0-1710656740293.png

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • MIA27 Profile Picture
    2 on at

    Yes, I am using the correct name, 

    I am testing it another screen, if success i will apply on the main required screen.

     

    Testing further found, its working some time and some time not.

    I suspect the failure is happening on the gallery on select property, it is not able to read all the time, 

    during test found, 

    I edited, saved, it worked for save.

    Then next record , selected, click on the form, this also saved, while no edit has been done

    Then moved to next select on the gallery, same it saved, while no edit done

    Then moved to next item in gallery, no edit done, this time message appears of notify.

     

    worried to apply such un sure method,

     

    Please advise

     

     

  • ANB Profile Picture
    7,250 Super User 2025 Season 2 on at

    Hi @MIA27 , The code looks good to me. You need to troubleshoot by checking one by one statement within Or() condition whether it is true or not.

     

    Also, hope you are using correct form name:

    SubmitForm(SupportEditForm);

    ResetForm(SupportEditForm)

     

    -----------------------------------------------------------------------------------------------------------------------------

    I hope this helps.

    Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍

    Thanks,
    ANB


  • MIA27 Profile Picture
    2 on at

    Dear ANB,

    Further update.

    While testing did some changes as below it worked but partially.

    All error gone, in both situation it saves, if edited saves, it not edited saves.

    I put a notification to obtain the result but notification does not appear,

    I thing a little more changes can bring the result

     

    If(
     Or(
     gblvar_Record.SerialNo <> DataCardValue1.Value, 
     gblvar_Record.JobAmt <> Value(DataCardValue2.Text), 
     gblvar_Record.LineNo <> Value(DataCardValue3.Text), 
     gblvar_Record.Model <> DataCardValue4.Value 
     ),
    SubmitForm(Form1);
    ResetForm(Form1),
    Notify("No Save Rquired as no Edit done",NotificationType.Information,2000)
    )

     

    Please guide 

  • MIA27 Profile Picture
    2 on at

    Copied and pasted the code exactly the same.

    It is giving error , please advise,

    In the image you can note the error and line point in red 

     

     

    MIA27_0-1710650773563.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 403

#2
WarrenBelz Profile Picture

WarrenBelz 338 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 320 Super User 2025 Season 2

Last 30 days Overall leaderboard