cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

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

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@DAVIDPOWELL 

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

View solution in original post

5 REPLIES 5
Super User III
Super User III

@DAVIDPOWELL 

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

View solution in original post

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

dave

@DAVIDPOWELL 

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

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

 

max is delegable. 

@DAVIDPOWELL 

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

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (44,119)