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 / Quick question - LastS...
Power Apps
Unanswered

Quick question - LastSubmit()

(2) ShareShare
ReportReport
Posted on by 241

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! 🙂

Categories:
I have the same question (0)
  • RezaDorrani Profile Picture
    12,143 on at

    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.

  • Verified answer
    mdevaney Profile Picture
    29,989 Moderator on at

    @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."

  • catrina0527 Profile Picture
    2 on at

    Another question.  WIth LastSubmit only working on a form in edit mode, What is the form is in view with a collection to capture annual checks for that item.  I only need to patch the collection item to SharePoint along with that form's item ID.  How do i write that?

  • Cat Schneider Profile Picture
    488 Most Valuable Professional on at

    Ok, @mdevaney, we can hash out later why I'm replying to your response, from almost 4 years ago, in this moment right now... regardless, this is the exact answer that I was looking for today! I knew about the LastSubmit property. I've used it on occasion, previously, back when I was first starting out in Power Apps and had not yet turned my nose up at the use of Forms controls... however, beating my head against my app today, I finally went in search of some answers and here, in all of it's glory, is an amazing response from you with more than just the answer to the question, but the detail to back it up... this here is the key!

    CatSchneider_0-1689296614824.png

    LastSubmit only seems to want to populate a value for use in variables, from right within the Form control's OnSuccess property. So, thank you my good sir! I owe you a drink when I see you in Vegas! 😊

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard