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 / Patch error when patch...
Power Apps
Answered

Patch error when patching from a collection back to its source

(0) ShareShare
ReportReport
Posted on by 25

Getting an error when patching from a collection back to its source as follows:
 
Dropdown1 OnChange:
ClearCollect(MHD,Filter(<Sharepoint list name>,<field name>=Dropdown1.Selected.Result))
 
Patch various fields (but never the modified field) in the collection based on user input into TextInput boxes when changed, then when user is ready they click a Save Icon.
 
Save icon, OnSelect:
Patch(<Sharepoint list name>,MHD)
 
Error:
Modified: The specified column is read-only and can't be modified.
 
Errors(<Sharepoint list name>)
.Column = Modified
.Error = 10
 

Categories:
I have the same question (0)
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    The problem is that in your collection you have all the values of the SP list including the modified column. So when you try to patch the collection back without explicitly telling it which columns to patch, it thinks you are trying to patch ALL columns. I would suggest specifying individual columns and use the FirAll function with Patch to patch all items within your collection to SP.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit(Haman)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @MB ,

    Do you want to patch your collection data back to your SP List?

     

    Based on the formula you provided, I think there is something wrong with it. The 'Modified' column ('Created', 'Created By', 'Modified By', ...) in SP list is a System field, which would be populated by SP System automatically. And the 'Modified' column ('Created', 'Created By', 'Modified By', ...) is Read-Only in PowerApps app, we could not specify a value for it manually.

     

    I have made a test on my side, please consider take a try with the following workaround:

    1. If you want to patch your MHD collection data as New records into your SP List, please consider modify your formula as below:

    ForAll(
     MHD,
     Patch(
     'SPList',
     Defaults('SPList'),
     {
     Column1: MHD[@Column1],
     Column2: MHD[@Column2],
     Column3: MHD[@Column3],
     ...
     }
     )
    )

     

    2. If you want to update these records in your SP List using the MHD collection, please modify your formula as below:

    ForAll(
     MHD,
     Patch(
     'SPList',
     LookUp('SPList', ID = MHD[@ID]),
     {
     Column1: MHD[@Column1],
     Column2: MHD[@Column2],
     Column3: MHD[@Column3],
     ...
     }
     )
    )

    Note: You could not specify System fields from SP List within '{}' part of above Patch function.

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Hi @MB the reply above uses the same approach as suggested by me AND also specifics the formulae to be used.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

    Hardit(Haman)
  • MB Profile Picture
    25 on at

    Thanks for the replies.  I was trying to avoid patching each field by listing them individually, and found doing it this way does in fact update the list.  It’s just that it generates the error message.

     

    Any ideas on how to ignore/clear the message before users see it?  Otherwise I will revert to patching the list directly as fields are updated, or workaround it as you suggested if I opt to keep the collection method.

     

    Personally I think it would be helpful if the function ignored ‘system generated’ fields.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi  @MB ,

    Have you taken a try with the solution I provided above? Do you mean it would generate error message?

     

    Based on the needs that you mentioned, I think the solution I provided above could achieve your needs. When you patch the whole MHD collection as argument within the Patch function, it would not ignore ‘system generated’ fields automatically.

     

    As an alternative solution, you could consider select these columns you want to save within the MHD collection when you set up your MHD collectioon.

    Please consider modify your formula as below:

    ClearCollect(
     MHD,
     ShowColumns(
     Filter(<Sharepoint list name>, <field name>=Dropdown1.Selected.Result),
     "Title",
     "Column2",
     "Column3",
     ....
     )
    )

    Note: Do not specify System fields within above ShowColumns function.

     

    Then you could modify your formula as below:

    Patch(<Sharepoint list name>, Defaults(<Sharepoint list name>), MHD) // Add new records

    If you want to update your SP List records based on the MHD collection, you should take a try with the solution I provided in previous reply (update fields value one by one).

     

    Best regards,

  • Verified answer
    MB Profile Picture
    25 on at

    Thanks for getting back to me.  I used ShowColumns to get all columns ex the 'system' ones into the Collection.  I was then able to execute patch(sharepoint list, collection) successfully without an error message, and without having to individually name all the columns in the patch statement.  Probably not much difference, but seems less typing not having to explicitly name them in the patch statement.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 94

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard