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 / 'The data source suppl...
Power Apps
Unanswered

'The data source supplied to the function is invalid' error, but everything is fine

(0) ShareShare
ReportReport
Posted on by 12

Hello,

 

I am getting following error when submitting my form:

avater4566_0-1699531859315.png

 

I am using the patch function twice, once to update my collection and once to update my data source (Excel): 

Patch(Excelfile;LookUp(Excelfile;id=Concatenate(First([@PowerBIIntegration].Data).Id;selectedItemGallery.id));{procentCompleted:DataCardValue1.Text});;Patch(collection;LookUp(collection;id=selectedItemGallery.id);{procentCompleted:DataCardValue1.Text})

Everything works and the updated items show up in both my collection and Excel sheet.

How can I make sure that the error does not occur again?

 

Thanks for helping me out! 

Categories:
I have the same question (0)
  • MudassarSZ365 Profile Picture
    591 on at

    Hi @avater4566 ,

    Patch(
     Excelfile,
     LookUp(Excelfile, id = Concatenate(First([@PowerBIIntegration].Data).Id, selectedItemGallery.id)),
     {procentCompleted: DataCardValue1.Text}
    );
    Patch(
     collection,
     LookUp(collection, id = selectedItemGallery.id),
     {procentCompleted: DataCardValue1.Text}
    )

    Kindly mark the solution as accepted if it resolves your issue.

    Best Regards
    Muhammad Mudassar Mazhar

  • avater4566 Profile Picture
    12 on at

    Hi @MudassarSZ365 ,

     

    Thank you but I don't get it, this is the exact same function as I had? 

  • MudassarSZ365 Profile Picture
    591 on at

    @avater4566 ,

    you are facing an issue with the Patch function, here are some common reasons why this error might occur:

    Incorrect Data Source: If Excelfile or collection does not refer to a valid data source or if there's a typo, the function would fail.

    Delegation Warning: If Excelfile is a large data set and is not delegable, the LookUp function might not be able to retrieve the record, and thus the Patch function would be trying to patch a non-existing or invalid record.

    Column Name Mismatch: The names used in the record schema of the Patch function must exactly match the column names of the data source.

    Data Type Mismatch: Ensure that the value you're trying to patch matches the data type of the target column in the data source.

    Access Rights: Check if the app has the correct permissions to write to the data sources.

    Corrupted Excel File: If the Excel file is corrupted or not properly formatted as a table, this could also result in an error.

    Syntax Error: If the syntax is incorrect, especially if you're using special characters or additional semicolons where they aren't needed, it could cause an error.

    Excel as Data Source: Excel is not the best data source for writing back data in Power Apps, especially for concurrent use. If possible, consider using SharePoint lists or Dataverse, which are more robust for these operations.

    Patch(Excelfile, LookUp(Excelfile, id = Concatenate(First([@PowerBIIntegration].Data).Id, selectedItemGallery.id)), {procentCompleted: DataCardValue1.Text});
    If(IsEmpty(Errors(Excelfile)), Notify("Update successful"), Notify("Error: " & First(Errors(Excelfile)).Message, NotificationType.Error));

    Kindly mark the solution as accepted if it resolves your issue.

    Best Regards
    Muhammad Mudassar Mazhar

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard