Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

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:
  • WarrenBelz Profile Picture
    146,670 Most Valuable Professional on at
    Error- Patch Function Not Saving
    You need to use whichever field is the unique identifier (no two records have the same value) in your table.
  • JP-24071314-0 Profile Picture
    10 on at
    Error- Patch Function Not Saving
    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
    146,670 Most Valuable Professional on at
    Error- Patch Function Not Saving
    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
  • Suggested answer
    SpongYe Profile Picture
    5,580 Super User 2025 Season 1 on at
    Error- Patch Function Not Saving
    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})
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,011 Most Valuable Professional

Leaderboard