<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to update dataflow M scripts from JSON file? in Service</title>
    <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1835654#M128317</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a dataflow in a developer workspace, then exported the dataflow as a JSON file and imported the dataflow from the JSON file into a production workspace, all successfully. Then I have made changes to the M code of the dataflow in the dev workspace. Now I want to export the JSON file from dev workspace and update the dataflow in prod workspace with the changed M code from the JSON file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to update an existing dataflow from a JSON file instead of creating a new dataflow from the JSON file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relevant difference is that if I delete the prod dataflow and import the JSON file as new, I would have to change all the datasets depending on the old dataflow to load from the new dataflow ID, which I want to avoid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
    <pubDate>Tue, 11 May 2021 09:14:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-05-11T09:14:27Z</dc:date>
    <item>
      <title>How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1835654#M128317</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have created a dataflow in a developer workspace, then exported the dataflow as a JSON file and imported the dataflow from the JSON file into a production workspace, all successfully. Then I have made changes to the M code of the dataflow in the dev workspace. Now I want to export the JSON file from dev workspace and update the dataflow in prod workspace with the changed M code from the JSON file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to update an existing dataflow from a JSON file instead of creating a new dataflow from the JSON file?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The relevant difference is that if I delete the prod dataflow and import the JSON file as new, I would have to change all the datasets depending on the old dataflow to load from the new dataflow ID, which I want to avoid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;</description>
      <pubDate>Tue, 11 May 2021 09:14:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1835654#M128317</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-11T09:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1839743#M128529</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After testing, I think you can try to directly&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;copy the updated M code in development workspace to the Advanced editor of the dataflow in production workspace. That will update an existing dataflow from a JSON file instead of creating a new dataflow from the JSON file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Winniz&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 03:02:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1839743#M128529</guid>
      <dc:creator>v-kkf-msft</dc:creator>
      <dc:date>2021-05-13T03:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1840049#M128540</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283692" data-lia-user-login="v-kkf-msft" class="lia-mention lia-mention-user"&gt;v-kkf-msft&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thank you for the support. This is actually what I currently do. But since I have multiple queries that I want to update in the dataflow, this is way more effort than importing all changes from one JSON file at once.&lt;BR /&gt;&lt;BR /&gt;Do you know whether changing the M code of the queries in the dataflow can be automated through Power BI API with Pro or Premium per User license?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Martin&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 06:56:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1840049#M128540</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-13T06:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1840205#M128549</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, according to the document&amp;nbsp;&lt;A style="background-color: #ffffff; outline: 0px;" href="https://docs.microsoft.com/en-us/rest/api/power-bi/dataflows" target="_self"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/dataflows&lt;/A&gt;&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;, it should be impossible to use Rest API to automatically update the M code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;Best Regards,&lt;BR /&gt;Winniz&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 07:47:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1840205#M128549</guid>
      <dc:creator>v-kkf-msft</dc:creator>
      <dc:date>2021-05-13T07:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1841456#M128585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283692" data-lia-user-login="v-kkf-msft" class="lia-mention lia-mention-user"&gt;v-kkf-msft&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you! This confirms my research. It seems the API doesn't know anything like a "Query" object in a dataflow, only dataflow level settings affecting all queries. I'll submit the JSON update as an idea.&lt;BR /&gt;BR&lt;BR /&gt;Martin&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 20:29:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1841456#M128585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-13T20:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1841461#M128586</link>
      <description>&lt;P&gt;The idea is already there:&amp;nbsp;&lt;A href="https://ideas.powerbi.com/ideas/idea/?ideaid=52fe5730-2afd-4111-950b-db73687e9fa5" target="_blank"&gt;Microsoft Idea &amp;nbsp;· Ability to override existing dataflow with JSON Model (powerbi.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 20:33:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/1841461#M128586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-13T20:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/3429653#M206069</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="283692" data-lia-user-login="v-kkf-msft" class="lia-mention lia-mention-user"&gt;v-kkf-msft&lt;/a&gt;&amp;nbsp;this is not correct.&amp;nbsp; There is a REST api that updates the M/PQ code for dataflows.&amp;nbsp; It is part of the "imports" API.&amp;nbsp; It doesn't work very well, and is pretty buggy.&amp;nbsp; But it is there.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 23:54:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/3429653#M206069</guid>
      <dc:creator>dbeavon3</dc:creator>
      <dc:date>2023-09-13T23:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/4776108#M282100</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know it is an old post, it seems it's still impossible to overwrite a DF with a JSON template.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a little tip to help:&lt;BR /&gt;In your queries which use the DF connector you can change the navigation steps in order to mention the dataflowName instead of the dataflowId.&lt;BR /&gt;Example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
   Source = PowerBI.Dataflows([]),
   WS = Source{[workspaceName="your_workspace_name"]}[Data],
   DF = WS{[dataflowName="your_dataflow_name"]}[Data]
in
   DF&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;If you do that you can delete the old DF and import the JSON file with the updated version. You will not have to modify the queries wich mention this DF.&lt;BR /&gt;&lt;BR /&gt;Florian&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 07:38:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/4776108#M282100</guid>
      <dc:creator>FADAVI</dc:creator>
      <dc:date>2025-07-25T07:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to update dataflow M scripts from JSON file?</title>
      <link>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/4776170#M282102</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently, Power BI does not provide a direct method to update an existing dataflow in a workspace using a JSON file without creating a new dataflow. When you export a dataflow as a JSON file and then import it into another workspace, it creates a new dataflow with a new ID, even if the name is the same. This means that datasets or reports connected to the original dataflow will not automatically switch to the new one, leading to broken links unless they are manually repointed. Unfortunately, Power BI does not support updating or overwriting an existing dataflow via JSON import in a way that retains the original dataflow ID. To work around this, you would need to manually update the M code within the existing dataflow in the production workspace using the Power BI Service interface or through the Power BI REST API (if supported), thereby preserving the original dataflow ID and avoiding the need to rebind dependent datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jul 2025 09:05:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Service/How-to-update-dataflow-M-scripts-from-JSON-file/m-p/4776170#M282102</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-07-25T09:05:26Z</dc:date>
    </item>
  </channel>
</rss>

