cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Regular Visitor

How to get list item id in submit form?

Hello Geeks,

This might a silly question but I would really need solution for this?

 

How could I get the Newly created List item Id on SubmitForm(form1). Its would be good if I get this id in OnSuccess or any other way around.

 

I need this value in the PowerApps same form after it is submitted

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to get list item id in submit form?

Hi @Gopal,

 

You should be able to get the Last submitted Record with the LastSubmit property of the EditForm control.

For Example:

EditForm1.LastSubmit

To Get the Id, switch to:

EditForm1.LastSubmit.ID

Adding the document for reference:

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

  • 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.

EditForm and Display form controls in PowerApps

 

If you have any further questions, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: How to get list item id in submit form?

Hi @Gopal,

 

You should be able to get the Last submitted Record with the LastSubmit property of the EditForm control.

For Example:

EditForm1.LastSubmit

To Get the Id, switch to:

EditForm1.LastSubmit.ID

Adding the document for reference:

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

  • 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.

EditForm and Display form controls in PowerApps

 

If you have any further questions, please post back.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: How to get list item id in submit form?

Hello @v-micsh-msft @Gopal

 

i am using 3 forms in my app and at last on click of a button, the data source is updated by using this formula 

Patch(DataSource, Item_Being_Edited, Form1.Updates, Form2.Updates, Form3.Updates).

And i am navigating to next screen where i use form viewer
Here i want to display the last submitted forms value.

How can i do this??

Highlighted
Helper I
Helper I

Re: How to get list item id in submit form?

I am trying to view the ID in a new form after been submitted and the screen goes blank and saus "No data to display". Any suggestions for this mater?

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: How to get list item id in submit form?

Hi @alex3

If you are using "SubmitForm(FormName)" to submit your data, use "FormName.LastSubmit.ID" to fetch the id and give to the form viewer on next screen.

Highlighted
Helper I
Helper I

Re: How to get list item id in submit form?

I tried it and still no luck. I added to the save button and it did not work. 😞
Highlighted
Advocate III
Advocate III

Re: How to get list item id in submit form?

I have the same issue. I tried the following, where TargetRequest is the Item property of my DisplayForm in the OnSuccess event of the EditForm

 

If(
    EditForm1.Mode = FormMode.New, 
    Navigate(DetailScreen1,Fade,{TargetRequest: EditForm1.LastSubmit}),
    Back())

If I was in Edit Mode, it will go back to the detail screen from where I invoked Edit Mode.

But if I was in New Mode, it as well goes back to the Gallery from where I invoked the Add new item.

Why would it ignore the Navigate function?

Highlighted
Frequent Visitor

Re: How to get list item id in submit form?

Hi @v-micsh-msft ,

 

Thanks for this. I was trying to update the Status of a newly submitted form to Pending Approval once the user clicks the submit button. I tried various methods but failed and your input on how to use the LastSubmit worked finaly.

 

Here is what I used for the OnSelect property of the Submit button

 

SubmitForm(CreateItemForm);Patch('Leave Requests', CreateItemForm.LastSubmit,{Status:"Pending Approval"});RequestHide()

 

Regards,

Rana1

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (8,668)