cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanielaHo
Advocate IV
Advocate IV

Quick question - LastSubmit()

Hi!

When users submit data via a NewForm, I generally like to show them the submitted data when NewForm.OnSuccess is true. So far I did this by passing the item data into a collection when the user clicks a button to SubmitForm(NewForm), then I display the data that is stored within the collection. However I am wondering if there is a better way, specifically using the LastSubmit() function.

 

But my question is:

Does LastSubmit() show the last record that was submitted as part of the app session or the last submitted item to the data source? 

 

The concern is of course that if the latter is true, the LastSubmit() function would not be ideal for solutions where multiple users submit nearly simultaneously.. 

 

Thanks! 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@DanielaHo 

You asked a very good question!  I am happy to tell you that LastSubmit will correctly retrieve the last record submitted during the current session.  This is beacuse LastSubmit is a property of the Edit Form.  It does not communicate with the datasource and therefore is not affected by when multiple users submit nearly simultaneously.

 

Here's the relevant section of the Form control documentation for reference.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

 

LastSubmit – The last successfully submitted record, including any server generated fields.

  • This property applies only to the Edit form control.
  • If the data source automatically generates or calculates any fields, such as an ID field with a unique number, the LastSubmit property will have this new value after SubmitForm successfully runs.
  • The value of this property is available in the OnSuccess formula.

 

This confirms the last successfully submitted ID is stored in the Edit Form properties. Now you have it in writing! 

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

2 REPLIES 2
RezaDorrani
Dual Super User II
Dual Super User II

Hi @DanielaHo 

 

Last item submitted for that user session

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

mdevaney
Super User
Super User

@DanielaHo 

You asked a very good question!  I am happy to tell you that LastSubmit will correctly retrieve the last record submitted during the current session.  This is beacuse LastSubmit is a property of the Edit Form.  It does not communicate with the datasource and therefore is not affected by when multiple users submit nearly simultaneously.

 

Here's the relevant section of the Form control documentation for reference.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-form-detail

 

LastSubmit – The last successfully submitted record, including any server generated fields.

  • This property applies only to the Edit form control.
  • If the data source automatically generates or calculates any fields, such as an ID field with a unique number, the LastSubmit property will have this new value after SubmitForm successfully runs.
  • The value of this property is available in the OnSuccess formula.

 

This confirms the last successfully submitted ID is stored in the Edit Form properties. Now you have it in writing! 

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,673)