web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error- Patch Function ...
Power Apps
Unanswered

Error- Patch Function Not Saving

(1) ShareShare
ReportReport
Posted on by 10
Hello!

Currently building a checklist with a gallery consisting of text, dropdown inputs and textbox inputs, and trying to get each to save with the users input, with using data from a sharepoint list, However I'm currently facing this error:
 

Gallery Code:

Onselect:
 
ForAll(Gallery3_1.AllItems,
Collect(
    TestCol,
    {
        answersc: inpanswers.Selected,
        evidencesc: inpevd.Text
    }
)
)


Input Code:
Onchange:

 
Patch(TestCol, ThisItem, {answersc: Self.Selected.Value})
 
Patch(TestCol, ThisItem, {evidencesc: Self.Text })

Been stuck on this for a while so any help would be appreciated! :)

 
 
Categories:
I have the same question (0)
  • Suggested answer
    SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at
    Hi,
     
    Looks like your Patch is not correct. 
    When collection answersc you type is a record. 
    So when you patch it needs to match the same type. 
     
    Try this with the Patch:
    Patch(TestCol, ThisItem, {answersc: Self.Selected})
     
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    The first explanation suggests that the Items of the Gallery are not exactly the same as the fields in the Collection, so ThisItem does not exactly match the target record. The other errors suggest that answersc is a Choice column. Assuming that you have a unique identifier in the record (I will use ID as an example), this may work
    Patch(
       TestCol, 
       LookUp(
          TestCol,
          ID = ThisItem.ID
       ),
       {answersc: Self.Selected}
    )
    
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • JP-24071314-0 Profile Picture
    10 on at
    Thank you @WarrenBelz! The explanation definitely helped, I do have ID as a column in the sharepoint list, but not in the record itself, how would I establish a unique ID for each entry/input in the collection?

    thank you!!

    edit: currently getting this error:


  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    You need to use whichever field is the unique identifier (no two records have the same value) in your table.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard