web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Last Submit ID on NewForm
Power Apps
Answered

Last Submit ID on NewForm

(0) ShareShare
ReportReport
Posted on by 95

i have one form(SharePointForm1) for creating new items and editing items in one screen. i'm hoping i can get the correct approach to retrieving the lD of  last submitted item by the current user. 
i have read in a couple of articles that you can only get the LastSubmitID from an edit form, which confuses me a little bit.

OnNew

 

NewForm(SharePointForm1)

 

 OnSave

 

SubmitForm(SharePointForm1);
Set(varLastSubmittedItem,SharePointForm1.LastSubmit.ID);

 

i get the ID sometimes, i'm just not sure if this is the right way to do this. And also how to ensure that SharePointForm1 is an EditForm

Categories:
  • eka24 Profile Picture
    20,925 on at

    Use:

    Set(varLastSubmittedItem,SharePointForm1.LastSubmit.ID) OnSuccess of the form SharePointForm1

     

    To Edit a form, insert a button and put OnSelect:
    EditForm(SharePointForm1)

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Gottijay1999 Profile Picture
    95 on at

    Onsuccess

    Set(varLastSubmittedItem,SharePointForm1.LastSubmit.ID);
    ResetForm(SharePointForm1); 
    RequestHide()

    OnSave

    SubmitForm(SharePointForm1);
    LastSubmitTest.Run(Text(varLastSubmittedItem));

     i put the set function in the OnSuccess property as you suggested, and tested it by putting a workflow after the submit function  in the OnSave property. the workflow received a blank value. I need the ID to be generated after the submit function. is that possible?

  • Verified answer
    eka24 Profile Picture
    20,925 on at

    If you are using the ID in a flow in that process, it not possible.

    Try:

    SubmitForm

    SubmitForm(SharePointForm1) 

    OnSuccess

    Set(varLastSubmittedItem,SharePointForm1.LastSubmit.ID);LastSubmitTest.Run(Text(varLastSubmittedItem));ResetForm(SharePointForm1); RequestHide()

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Gottijay1999 Profile Picture
    95 on at

    Thank you

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard