cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StuartSmith
Resolver I
Resolver I

Patch SP List from Collection

I have a collection called "colUserDetails" with columns called "Name", "UserID", "EmailAddress", "Floor", "Zone" & "SeatNumber".  The collection will only ever have 1 row.

 

I then have an SP List called "Monitor App" with the same columns as the collection.  All columns are "Single line of Text" type.  

 

I need to patch the data in the collection to the SP list.  I have watched so many videos and read so many web pages, but still I cant get it to patch. Please help.

Thanks, in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
StuartSmith
Resolver I
Resolver I

Figured it out, the issue with the SP wanted a "Title" value for the patch, despite removing the "Title" column from the list.  Anyway, added "Title: "Blah" and the patch worked.

View solution in original post

3 REPLIES 3
martijnA
Helper I
Helper I

Patch('Monitor App', Defaults('Monitor App'),

{

Name: First(colUserDetails).Name,

UserID: First(colUserDetails).UserID,

Floor: First(colUserDetails).Floor,

Zone: First(colUserDetails).Zone,

SeatNumber: First(colUserDetails).SeatNumber,

EmailAddress:First(colUserDetails).EmailAddress})

 

___________________________________________________________________________________

If I have answered your question, please mark your post as Solved
If you like my response, please give it a Thumbs Up

StuartSmith
Resolver I
Resolver I

Figured it out, the issue with the SP wanted a "Title" value for the patch, despite removing the "Title" column from the list.  Anyway, added "Title: "Blah" and the patch worked.

SebS
Solution Sage
Solution Sage

Hi @StuartSmith,

 

If Your Collection have the same schema as your SP List it should be easy as

 

 

Patch('Monitor App',colUserDetails)

 

Just keep in mind columns in SP List need to have same name as collection columns to use above approach

 

If you looking to Patch only Selected columns it will look like this and then columns can have some name variations you will match columns in Patch as Below

 

 

Patch('Monitor App',
    ForAll(colUserDetails As _items,
       {
         ID: _items.ID
         Name: _items.Name
         UserID: _items.UserID
       }
    )
)

 

 

Hope that Help

 

Regards


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,305)