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 / submit data to a share...
Power Apps
Answered

submit data to a sharepoint list from labels and then get the lastid from a large list

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have 3 labels on a screen

I have a sharepoint list with over 3122  records  called  "list_Login_entry"

 

Label1 =  user_id

Label2 = UserName

Label3 =  Date   now()

Label4 =  Last ID

 

 

What I need:

On a button I need to create a new record in a sharepoint list and add this data to columns

sp_user_id

sp_UserName

sp_DateTime

 

 

label 4  to display the last ID 

Is it possible to use patch for this ?

 

Dave

 

 

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    To create a new record using the Label contents do this:

     

    Patch(
     your_SPlist_name,
     Defaults(your_SPlist_name),
     {
     sp_user_id: Label1.Text,
     sp_Username: Label2.Text,
     sp_Datetime: DateTimeValue(Label3.Text)
     }
    )

     

     

    The next SharePoint Id gets patched automatically so that’s why I did not include it in the PATCH.

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    label4  was just to display the last ID , I did not mean to include it in the PATCH sorry..

    dave

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    Cool.  Did my suggestion work?

     

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

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I need some function or method to get the last id in a Large list  ?

     

    max is delegable. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @Anonymous 

    The function to get the last ID in a list is:

     

    First(Sort(your_SPlist_name, ID, Ascending)).ID


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

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 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard