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 feature doesn't ...
Power Apps
Answered

Patch feature doesn't recognize column

(0) ShareShare
ReportReport
Posted on by 222

I'm trying to update an existing record with a group of users who are added later. The Users column is a multi-line text field. I have in use in the app the list name, the ID of the previously created item in a variable, and a collection and a string of the users. What I don't have at use in the app is the actual Users column that I want to update. When I add the patch to my submit button, it says it doesn't recognize the column:

Patch('My List Name',{ID: Value(ItemID.Text)},['Users':AllItemsString])

I also tried it with UpdateIf, but then I get errors about improper use of the colon:

UpdateIf('My List Name',ID: Value(ItemID.Text),{Users:AllItemsString})

I'm sure my syntax is wrong, but from what I found online through Microsoft and through other questions posted to the community, it looks right. Any suggestions?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @ACPBSCi 

    Typically, patch syntax has three parts, the datasource being patched, the record being patched and the fields being patched. 

     

    Patch(Datasource, Lookup(Datasource,ID=Gallery1.Selected.ID),{Field1:Dropdown1.Selected.Value,Field2:Datepicker1.SelectedDate,Field3:TextInput1.Text, etc})

     

    In the event that a new item is being added, then the second element is  changed to Defaults(Datasource) to indicate that this is a new item that is using the default fields. 

     

    Patch(Datasource, Defaults(Datasource),{Field1:Dropdown1.Selected.Value,Field2:Datepicker1.SelectedDate,Field3:TextInput1.Text, etc})

     

    The fields use a colon to indicate the name of the field (column) and where the data is coming from. Commas separate the fields.  and all of the fields are enclosed in curly braces.


    Patch is one of the most versatile PowerApps functions but it is also very confusing to new developers. ref https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch 

     

    For more information on Patch and SharePoint complex column types, see https://www.c-sharpcorner.com/article/powerapps-patch-fuction-with-complex-columns/ 

     

  • ACPBSCi Profile Picture
    222 on at

    I'm still getting errors. I have entered this:

    Patch('My List Name', Lookup('My List Name',ID=ThisItemInfo_1.ItemID_1.ID),{Users:AllItemsString})

    and I get the following errors:

    • The = in gives an error of "invalid argument type"
    • The .ItemID_1 gives an error of "Name isn't valid. This identifier isn't recognized."
    • The .ID gives an error of "Invalid use of ' '."

    ".ItemID_1" is a label. Is that the issue? I couldn't figure out how to get the actual ID field into my gallery, it only seems to let me add labels. So I added a label, had it display the ID for the current item, then save that ID to a variable for use later on. Do I need the actual ID field in order to make this work? Can I use the variable instead?

  • Verified answer
    ACPBSCi Profile Picture
    222 on at

    GOT IT!! Yes, the Patch feature is hugely useful and powerful and yes, insanely complicated to understand. After a bit of trial and error:

    Patch('My List Name', LookUp('My List Name',ID=Value(ItemID_1.Text)),{Users:AllItemsString})

    Note the subtle differences. This is working and I am thrilled! Thank you @Drrickryp

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
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard