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

why i cannot patch the collection ?

(0) ShareShare
ReportReport
Posted on by

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
    on at
    Patch(colKapas; {Mitarbeiter:DataCardValue15_8.Text; Kapazität:TextInput3_3;Monat: DataCardValue17_8.Selected.DateMonthYear})
  • ANB Profile Picture
    7,223 Super User 2025 Season 2 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
    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,223 Super User 2025 Season 2 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
    on at

    same error !

  • Community Power Platform Member Profile Picture
    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
    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

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