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 / Writing edits and addi...
Power Apps
Answered

Writing edits and additions to a place other than the datasource

(0) ShareShare
ReportReport
Posted on by 4

I have a canvas app built on the samples provided.

The datasource used is a table in Excel that has been created via a PowerQuery.

Edits and additions all work well. That is until I refresh my PowerQuery and everything is wiped out back to how it was before the edits, which is logical.

The PowerQuery has to be refreshed frequently because the data is of project numbers and descriptions that will keep growing.

What I would like to do is be able to write the edits and additions to a separate datasource. I can not figure out how to do this.

If they are written to a different datasource that can be merged into the PowerQuery and will not be affected by a data-refresh.

I have been trying to figure out if the Patch function will work.

Hopefully my problem makes sense!

Any guidance will be appreciated.

Thanks

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @plebhead22 ,

    Do you mean that the data in your Excel table is pulled from other data source using Power Query?

    Which data source does your Excel table pull data from?

    Further, do you add your Excel table as data source within your app, and want to update the data within it using PowerApps?

     

    Based on the operation that you made, I think you have some misunderstanding on PowerQuery functionality in Excel. The PowerQuery functionality in Excel is used to pull data from external data source into current Excel table. When you refresh your PowerQuery in Excel, it would re-load data from external data again.

    In other words, if you made some changes within your Excel table, it just affect your Excel table itself rather than the underlying data source (which your Excel table pull data using PowerQuery from). When you refresh PowerQuery, the data within your Excel table would be overrided with data from the underlying data source again.

     

    As an fixed solution, please consider take a try to add the underlying data source (which your Excel table pull data using PowerQuery from) as data source within your app, then made changes to the underlying data source (rather than your Excel table) using your app.

    More details about adding data source within an app, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/add-data-connection

     

    If you want to update the underlying data source using Patch function, please take a try with the following workaround:

    Patch( /* <-- Add new record to data source */
     'YourDataSource',
     Defaults('YourDataSource'),
     {
     Column1: "xx",
     Column2: "xx",
     ...
     }
    )
    Patch( /* <-- Update an existing record in your data source */
     'YourDataSource',
     LookUp('YourDataSource', PrimaryKeyColumn = "xxx"), /* <-- Find the record you want to update based on PrimaryKeyColumn in your data source */
     {
     Column1: "xxx",
     Column2: "xxx",
     ...
     }
    )

    More details about Patch function, please check the following article:

    Patch function

     

    Best regards,

  • plebhead22 Profile Picture
    4 on at

    Many thanks

    Editing the true source is something I had not considered - before it goes into PowerQuery - that makes perfect sense.

    I will give that and Patch a try.

     

    Thnaks for your time and help.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard