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 / why i cannot patch the...
Power Apps
Unanswered

why i cannot patch the collection ?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

This is the error i get:

 

Akki2995_0-1696863635331.png

 

Categories:
I have the same question (0)
  • PPDEV Profile Picture
    142 on at

    Hello @Anonymous,

     

    Can you provide your "Patch" code? So we could take a look where you're error coming from? But upon checking the issue provided in the screenshot, it seems like you are missing the "Defaults" expression in the patch.

    The structure should look like this:

     

    Patch(
     DataSource,
     Defaults(DataSource), // Specifies the record to update or create if it doesn't exist
     { // Column-value pairs to modify or create
     Column1: NewValue1,
     Column2: NewValue2,
     // ...
     }
    )

     

     

    Thank you!


    Please consider accepting my solution if it has resolved your issue, as it can help others with similar problems.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    Patch(colKapas; {Mitarbeiter:DataCardValue15_8.Text; Kapazität:TextInput3_3;Monat: DataCardValue17_8.Selected.DateMonthYear})
  • ANB Profile Picture
    7,250 Super User 2026 Season 1 on at

    Hi @Anonymous , Can you please elaborate where you get the error?

    What are you doing?

    Is there any flow involved?

    Does the flow is triggered from PowerApps? 

    As the error message which I believe in Germán language says that "The data source passed to the function is invalid", so what is the data source?

     

    Make sure that the schema of the source and the collection must match.

     

    Please help us with the background of the issue because we cannot see your screen.

    -----------------------------------------------------------------------------------------------------------------------------
    I hope this helps.

    Please click Accept as solution ✅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 Thumbs up.👍

    Thanks,
    ANB

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    No there is no flow, the data source is a collection 

  • PPDEV Profile Picture
    142 on at

    Hello @Anonymous, please try this:

    Patch(
     colKapas, 
     Defaults(colKapas), // This line initializes a new record with default values
     {
     Mitarbeiter: DataCardValue15_8.Text,
     Kapazität: TextInput3_3.Text,
     Monat: DataCardValue17_8.Selected.DateMonthYear
     }
    )

     

    Thank you!


    Please consider accepting my solution if it has resolved your issue, as it can help others with similar problems.

  • ANB Profile Picture
    7,250 Super User 2026 Season 1 on at

    HI @Anonymous , Please check what @ppDev_30 is suggesting. Defaults is required when you want to create new record and use LookUp function if you want to update existing record.

     

    Thanks,

    ANB

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    same error !

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    i do not want to create a new record , i want to edit one

  • PPDEV Profile Picture
    142 on at

    Hello @Anonymous, if you want to update an existing record, you should change the "Defaults" to "LookUp", something like this:

    Patch(
     colKapas, 
     LookUp(colKapas, ID = ThisItem.ID), // Please update the source on this line
     {
     Mitarbeiter: DataCardValue15_8.Text,
     Kapazität: TextInput3_3.Text,
     Monat: DataCardValue17_8.Selected.DateMonthYear
     }
    )

     

    Thank you!


    Please consider accepting my solution if it has resolved your issue, as it can help others with similar problems.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    no it is a gridable gallery like here:

     

    and still the same error !

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard