cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User III
Super User III

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

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

Highlighted
Super User III
Super User III

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

@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
Highlighted
Super User III
Super User III

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

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

Highlighted
Super User III
Super User III

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

@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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,870)