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 / Using LastSubmit & Pat...
Power Apps
Answered

Using LastSubmit & Patch to update a record - invalid argument type error

(0) ShareShare
ReportReport
Posted on by 588

I have an app where I want users to be able to share the record they have just submitted with other users. I have taken the 'People' screen template for users to select the people they want to share with, I then want to patch the email addresses of these people to a column 'SharedWith' in the SharePoint list. 

 

I am struggling with patching the email address information to the record which was just submitted. 

 

I have tested that the LastSubmit.ID function is returning a number (the label with 141 shown in the screenshot below), but I still get the error, 'invalid argument type (number), expecting a Record value instead'

errorlastsubmit.png 

Patch(LAB01, NewFormFill.LastSubmit.ID, {SharedWith: ShareWithEmail.Text})

I don't know if this is relevant but I am testing this on the 'New' form; there is a separate Form with allows users to edit previously submitted records, ideally I want this button to be table to take from whichever was last completed (either NewFormFill or EditFormFill), and patch to the relevant record.

 

Also probably of note is that I have a hidden label 'ShareWithEmail' which has a conCat function which lists the emails in one place rather than taking them straight from the collection. I couldn't figure out how to just take the emails, so this seemed the easiest way at the time. I am probably wrong and look forward to being corrected if that's the case.

 

tldr; how do I Patch to the last submitted record?

 

Categories:
  • Verified answer
    misc Profile Picture
    588 on at

    I'm such an idiot.

     

    I didn't need the .ID so the function 

     

    Patch(LAB01, NewFormFill.LastSubmit, {SharedWith: ShareWithEmail.Text})

     

    now works fine.

     

    I can't figure out how to delete this thread so I'm going to leave it up for my own shame and perhaps it will help others. 

  • Pablo Carceller Profile Picture
    Microsoft Employee on at

    Hello @misc, thank you the information! 

     

     

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard