cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shoebwk
Helper III
Helper III

Get record ID from SP list for a new record

Hi,

I need an help where I want to pull the ID for the new record just created in SP list on Submit button action SubmitForm(newform1) so that I can add an additional function immediately after creation of the record.

3 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User
Super User

@shoebwk 
You can get the ID number of the record created by SUBMITFORM using this code

Form1.LastSubmit.ID

 

Therefore, you can get the next ID number by doing this

Form1.LastSubmit.ID + 1

 

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

@shoebwk 

If you wanted to get a different column name, for example Column1, you could use this code.

 

Form1.LastSubmit.Column1

 

Here's an example of how to write and email:

 

Office365Outlook.SendEmailV2(
    "recipientname@yourcompany",
    "Subject Line",
    "Body of text goes here<br>
    <br>
    ID: "& Form1.LastSubmit.ID &"<br>
    Column1: "& Form1.LastSubmit.Column1 &"<br>
    Column2: "& Form1.LastSubmit.Column2
)

 

 

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

ganeshsanap
Super User
Super User

@shoebwk You can get the ID of newly created item using:

 

newform1.LastSubmit.ID

 

Similarly, you can get the other columns also from the LastSubmit like:

 

newform1.LastSubmit.Title

 

Additionally, you can set this values to variable like below and use them in your further functions:

 

Set(lastItemTitle, newform1.LastSubmit.Title)

 


Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it 👍

View solution in original post

6 REPLIES 6
mdevaney
Super User
Super User

@shoebwk 
You can get the ID number of the record created by SUBMITFORM using this code

Form1.LastSubmit.ID

 

Therefore, you can get the next ID number by doing this

Form1.LastSubmit.ID + 1

 

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

Still figuring out how can I get the some variable data from the last record in the sendemailv2 functions.

Eventually the Submit button will create a new record and send the email including some values from this record.

Any help on the syntax much appreciated.

@shoebwk 

If you wanted to get a different column name, for example Column1, you could use this code.

 

Form1.LastSubmit.Column1

 

Here's an example of how to write and email:

 

Office365Outlook.SendEmailV2(
    "recipientname@yourcompany",
    "Subject Line",
    "Body of text goes here<br>
    <br>
    ID: "& Form1.LastSubmit.ID &"<br>
    Column1: "& Form1.LastSubmit.Column1 &"<br>
    Column2: "& Form1.LastSubmit.Column2
)

 

 

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

ganeshsanap
Super User
Super User

@shoebwk You can get the ID of newly created item using:

 

newform1.LastSubmit.ID

 

Similarly, you can get the other columns also from the LastSubmit like:

 

newform1.LastSubmit.Title

 

Additionally, you can set this values to variable like below and use them in your further functions:

 

Set(lastItemTitle, newform1.LastSubmit.Title)

 


Please click Accept as solution if my post helped you solve your issue. This will help others find the correct solution easily. It also closes the item. If the content was useful in other ways, please consider giving it 👍

View solution in original post

Thank you for the detail solution, I am almost there just struggling with the syntax. please help

Sorted used office365Outlook.

Is there a way to change the font and its size?

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,747)