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 / Function Patch : Inval...
Power Apps
Answered

Function Patch : Invalid argument type (Table). Expecting a Record value instead.

(0) ShareShare
ReportReport
Posted on by 53

Hello everyone,

I need your help.
I'm trying to update a sharepoint list base with data from a collection. But I'm encountering errors that I don't understand. Because I've already used the formula in another application that works.

I've already looked for solutions among the old forum questions, but I can't find one that works in my case.

Here's my formula for my collection.

 

 

Clear(bobinesv2);;
ForAll(
 Gallery2_3.AllItems;
 Collect(
 bobinesv2;
 {
 Titre: refbobine_3.Value;
 Compatibilite: drcompat_4.Selected;
 BobineBloquee: bobbloquee_2.Selected;
 'Raison de dérogation': Rderogation_3.SelectedItems;
 'Commentaire compatibilité': commentcmptlite.Value
 }
 )
);;

 

 

Here's my formula for the Patch function, which doesn't work.

 

 

Patch('Base bobines';Filter('Base bobines';NumComPiste = ncmdPiste_1.Text);bobinesv2)

 

 

Here's the error message : Invalid argument type (Table). Expecting a Record value instead.

 

Can anyone help me solve this error ?

forum.png
Categories:
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @aouattara ,

     

    The Patch function is used to update one record, Filter returns table but not record.

    What is this? Is value of NumComPiste distinct?

    ncmdPiste_1.Text

    If you want to update value of collection to list, I recommend you try ForAll function.

    You can also use value of gallery to update list directly.

    Assuming that you want to update multiple records of list according to each numdPiste_1.Text 

    ForAll(Gallery2_3.AllItems As C,UpdateIf('Base bobines',NumComPiste=C.ncmdPiste_1.Text,{ColumnName1:C.refbobine_3.Value,ColumnName2:C.drcompat_4.Selected}))

     

     

     

    Best regards,

    Rimmon

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    hey @aouattara 

     

    can u try this:

    ForAll(
     bobinesv2,
     Patch(
     'Base bobines',
     LookUp('Base bobines', NumComPiste = ncmdPiste_1.Text, Titre = Titre),
     {
     Titre: Titre,
     Compatibilite: Compatibilite,
     BobineBloquee: BobineBloquee,
     'Raison de dérogation': 'Raison de dérogation',
     'Commentaire compatibilité': 'Commentaire compatibilité'
     }
     )
    )
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • aouattara Profile Picture
    53 on at

    Yes, ncmdPisite_1.Text is the value of  NumComPiste that I collect from a gallery.  

    NumComPiste is a name one of the columns in my sharepoint list.

     

    You are right I want to update multiple records of list according to each numdPiste_1.Text.

    Thanks, I will try your solution.

  • aouattara Profile Picture
    53 on at

    Thank. I will try your solution

  • aouattara Profile Picture
    53 on at

    Hello @v-mengmli-msft 

    I've tried your solution, but it doesn't work properly in my case. Because all the records in the sharepoint list are updated with the values of the last record in the gallery.

    Attached is a screenshot of my screen

     

    forum2.png
  • v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @aouattara ,

     

    Could you please show screenshots about result of list? Where are you putting the formula on? "Valider" button?

    Please provide the formula you are using.

     

     

    Best regards,

    Rimmon

  • aouattara Profile Picture
    53 on at

    Hello  @v-mengmli-msft 

     

    Here's the screen of list (Result of the patch button Onselect formula). You can see that it's the value of the last record in the collection that has been put into the two records in the list.


    My approach: First I collect the records in “bobinesv2” from the gallery.
    Then I update the list with the values from the collection.

    result of patch button.png

     

    Here's the screenshot of "Valider" button formula. It's to collect the records from the gallery.

    Button valider.png

     

    Here's the result of the collection "bobinesV2"  I'm trying to put in the list for the update.

     

    result of collection bobinesv2.png

     

    Here's the screenshot of the "Patch button" formula

    patch button.png

    Thanks in advance

  • Verified answer
    v-mengmli-msft Profile Picture
    Microsoft Employee on at

    Hi @aouattara ,

     

    This is because the ForAll is related to bobinesv2, but you get value from gallery. The value will be first item or last item of gallery in default.

    As the value of collection comes from gallery, I recommend you update the list with value of gallery instead of collection.

    Please try this.

    ForAll(
     Gallery2_3.AllItems As C,
     Patch(
     'Base bobines',
     LookUp('Base bobines', NumComPiste = C.ncmdPiste_1.Text&& Titre = C.refbobine_3.Value),
     {
     Titre: C.refbobine_3.Value,
     Compatibilite: C.drcompat_4.Selected,
     BobineBloquee: C.bobbloquee_2.Selected,
     'Raison de dérogation': C.Rderogation_3.SelectedItems,
     'Commentaire compatibilité': C.commentcmptlite.Value
     }
     )
    )

     

     

    Best regards,

    Rimmon

  • aouattara Profile Picture
    53 on at

    Hi @v-mengmli-msft 

     

    Thanks you. It works

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard