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 / Stop Form Reset after ...
Power Apps
Unanswered

Stop Form Reset after Submit

(0) ShareShare
ReportReport
Posted on by 115

Hello Community,

 

unluckily I cannot figure out how I can stop my form from resetting after submitting it.

 

I have these Setting on the OnSuccess Property: 

Set(varrecord;Form1.LastSubmit);;
NewForm(Form1)

 

My Default Form Mode is FormMode.New. When I hit the Submit Button it patches all data to the SP list like I want to, but I would like the entries in the form not to disappear. 

Can anybody give me a hint how to achieve this?

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    NewForm(Form1) - It sets the display mode of the form to new. So, it will clear the fields.

     

    Why don't you try removing that?

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

  • noobi Profile Picture
    115 on at

    Hello Nogueira1306,

    Thank you for the help.

    If I remove NewForm(Form1) then the Form completely disappears after Submitting it. 

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Because it expects a new item...

     

    Why dont you try, when you submit the item, you navigate to a new screen with a view form that has that Item?

    On the item property of the view or edit form you write: First(Sort(DataSource, Created, Descending))

     

    Or you can change the display mode of the form:

     

    Something like this:

     OnSuccess property of the form:

    EditForm(Form1);

     

    On Item property of the form:

     

    If(Form1.DisplayMode = DisplayMode.Edit, First(Sort(DataSource, Created, Descending)))

     

    It should work

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

  • noobi Profile Picture
    115 on at

    Hello Nogueira,

     

    sorry for the misunderstanding. I wanted the items not to disappear and also make them editable, after submit. I changed the default property of the single items in the Form to varrecord.Description and varRecord.Attachments etc.. Maybe there is a better solution out there. Thank you for your time

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    HI @noobi ,

    On the button's onSelect property (the button which is used to open NewForm/Screen), use this formula - NewForm(Form1);Navigate(FormScreen)
    In your form, you change change the form Mode to Edit and in Item property you can use LookUp(Sort(SPList,Created, Descending),'Created By'.Email=User().Email)

  • Verified answer
    WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    Hi @noobi ,

    I will add a process here and hope I have not misunderstood your requirements. The DefaultMode does not really matter as it only controls what the form does if you open it without telling Power Apps the mode you need. In your case, you are asking it to go into New mode, which means all the fields will be blank unless you have specifically coded them to have a Default value that is not the field stored in the form's data source (which the "standard" Default is).

    The important thing is that when a form is submitted and changes mode, it refreshes to the Defaults of that mode. When you have created a new record and you want to change the Form to either View or Edit Mode and still show the same record you have just created, one way (I will assume you are using SharePoint here) is to set a Record Variable on Form OnSuccess

    Set(
     gblRecord,
     Self.LastSubmit
    );
    EditForm(Self) //or ViewForm

    then the Item of the Form

    Lookup(
     SPListName,
     ID = gblRecord.ID
    )

    Also when you select the record from your Gallery

    Set(
     gblRecord,
     ThisItem
    );
    Navigate(YourFormScreen);
    EditForm(YourFormName) //or ViewForm
    

    I hope you find this useful.

     

    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.

    Visit my blog Practical Power Apps

  • noobi Profile Picture
    115 on at

    Thank you Warren. Solving it with a LookUp would be useful if that data would be stored and edited later on. 

  • thetthenew Profile Picture
    7 on at

    Hi @WarrenBelz , 

    I did add editform(Customer_form) in onsuccess but when I submit, the form change to no item to display . 
    Do you have any idea ? 

    this is functions in onselect in submit button -

     Set(vartest , DataCardValue3.Text);
    Set(vardisablebutton , 1);
    SubmitForm(Customer_form);

  • WarrenBelz Profile Picture
    153,034 Most Valuable Professional on at

    @thetthenew ,

    Please read the details in my post - the process is there.

  • emdluc_ Profile Picture
    2 on at

    Hello @thetthenew I have the same issue, did you manage to find a solution?

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
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard