cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tran
Frequent Visitor

EditForm - How can I retain the values of the new record after submission.

Hi 

 

I notice that after I submitted a new record via EditForm, the values of the fields in the EditForm automatically reverts to the values of the fields from the previously selected record. Is there a way to retain the values from the new record I just entered after hitting "Submit"?

 

My scenario is for a user to enter a new record, once they click on the "Submit" button, they stay on the same screen showing the new values they just entered. 

 

Many thanks

 

Tran

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Yes. Use a variable for the item property of your form.

 

On select of an item from the gallery:

Set(Var_formitem, gallery1.selected.ID)

 

after submit of new record, Set(Var_formitem,Form1.LastSubmit.ID)

 

set the item property of your form to Var_formitem.

 

this will make the form show the selected record when selecting a record to edit, and will make the form show the new record when it is selected.

 

you will also need to change the form to edit after submitting the record

View solution in original post

mdevaney
Super User III
Super User III

@Tran 

Ive got a method that works.

 

Put this code in your button used to navigate to the Screen with your Edit Form


Set(varCurrentRecord, Blank());

NewForm(Form1);

Navigate(‘Edit Form Screen’);

 

Then use this code in the Item property of your Edit Form

 

varCurrentRecord

 

This code goes in the OnSelect property of your Submit button

 

SubmitForm(Form1);

 

Finally, put this code in the OnSuccess property of your Edit Form

 

Set(varCurrentRecord, Form1.LastSubmit);

ViewForm(Form1);

 

Now when you click the submit button the Form will retain its previous values.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2

Yes. Use a variable for the item property of your form.

 

On select of an item from the gallery:

Set(Var_formitem, gallery1.selected.ID)

 

after submit of new record, Set(Var_formitem,Form1.LastSubmit.ID)

 

set the item property of your form to Var_formitem.

 

this will make the form show the selected record when selecting a record to edit, and will make the form show the new record when it is selected.

 

you will also need to change the form to edit after submitting the record

View solution in original post

mdevaney
Super User III
Super User III

@Tran 

Ive got a method that works.

 

Put this code in your button used to navigate to the Screen with your Edit Form


Set(varCurrentRecord, Blank());

NewForm(Form1);

Navigate(‘Edit Form Screen’);

 

Then use this code in the Item property of your Edit Form

 

varCurrentRecord

 

This code goes in the OnSelect property of your Submit button

 

SubmitForm(Form1);

 

Finally, put this code in the OnSuccess property of your Edit Form

 

Set(varCurrentRecord, Form1.LastSubmit);

ViewForm(Form1);

 

Now when you click the submit button the Form will retain its previous values.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,359)