Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Copy Query to Clipboard bug

PowerBI behaves buggy when copying queries to clipboard. I started investigating this, as I am the developer of https://powerqueryformatter.com where I integrated a feature that allows pasting queries with dependencies directly from powerBI into the editor (much like you can copy and paste queries with dependencies in powerbi). The feature works well in chrome but it does not work in Firefox where the content with mime-type "text/html" is always empty string.

I started investigating what is copied to the clipboard by powerbi using this tool https://www.nirsoft.net/utils/inside_clipboard.html . Under format "HTML Format" the content in the clipboard that is set by PowerBI looks like this

Format:HTML Format
Version: 1.0
StartHTML: 0
EndHTML: 0
StartFragment: 0
EndFragment: 0
<!DOCTYPE html>
<html>
<body><!--StartFragment--><div class="microsoft-mashup-format">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&lt;Mashup xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://schemas.microsoft.com/DataMashup&quot;&gt;&lt;Client&gt;PBIDesktop&lt;/Client&gt;&lt;Version&... Name=&quot;FaktArbeitszeiten&quot;&gt;&lt;Formula&gt;&lt;![CDATA[let
Quelle = Excel.Workbook(Web.Contents(&quot;https://mogulargmbh.sharepoint.com/sites/mogularOrga/Freigegebene%20Dokumente/Zeiterfassung%20Uli/Ze...;), null, true),
tblArbeitszeiten_Table = Quelle{[Item=&quot;tblArbeitszeiten&quot;,Kind=&quot;Table&quot;]}[Data],
#&quot;Andere entfernte Spalten&quot; = Table.SelectColumns(tblArbeitszeiten_Table,{&quot;Tag&quot;, &quot;Arbeitszeit&quot;, &quot;Abwesenheit&quot;, &quot;Kommentar&quot;}),
#&quot;Ge&#228;nderter Typ&quot; = Table.TransformColumnTypes(#&quot;Andere entfernte Spalten&quot;,{{&quot;Tag&quot;, type date}, {&quot;Arbeitszeit&quot;, type time}, {&quot;Abwesenheit&quot;, type text}}),
#&quot;Hinzugef&#252;gte benutzerdefinierte Spalte&quot; = Table.AddColumn(#&quot;Ge&#228;nderter Typ&quot;, &quot;Benutzerdefiniert&quot;, each (Time.Hour([Arbeitszeit]) * 60 + Time.Minute([Arbeitszeit])) / 60),
#&quot;Umbenannte Spalten&quot; = Table.RenameColumns(#&quot;Hinzugef&#252;gte benutzerdefinierte Spalte&quot;,{{&quot;Benutzerdefiniert&quot;, &quot;Arbeitszeit in h&quot;}}),
#&quot;Entfernte Spalten&quot; = Table.RemoveColumns(#&quot;Umbenannte Spalten&quot;,{&quot;Arbeitszeit&quot;}),
#&quot;Gefilterte Zeilen&quot; = Table.SelectRows(#&quot;Entfernte Spalten&quot;, each [Arbeitszeit in h] &lt;&gt; null and [Arbeitszeit in h] &lt;&gt; 0 or [Abwesenheit] &lt;&gt; null),
#&quot;Ge&#228;nderter Typ1&quot; = Table.TransformColumnTypes(#&quot;Gefilterte Zeilen&quot;,{{&quot;Arbeitszeit in h&quot;, type number}}),
#&quot;Gefilterte Zeilen1&quot; = Table.SelectRows(#&quot;Ge&#228;nderter Typ1&quot;, each [Tag] &gt;= #date(2019, 10, 1))
in
#&quot;Gefilterte Zeilen1&quot;]]&gt;&lt;/Formula&gt;&lt;LoadToReport&gt;true&lt;/LoadToReport&gt;&lt;IsParameterQuery&gt;false&lt;/IsParameterQuery&gt;&lt;IsDirectQuery&gt;false&lt;/IsDirectQuery&gt;&lt;/Query&gt;&lt;/Items&gt;&lt;/Mashup&gt;</div><!--EndFragment--></body>
</html>

 

Note that in the header StartHTML and EndHTML as well as StartFragment and EndFragment are all 0. If we refer to this clipboard api specification https://docs.microsoft.com/en-us/windows/win32/dataxchg/html-clipboard-format these properties must be filled with the corresponding values. Maybe chrome is able to determine these values without explicitely setting them in the header but apparently firefox isn't able to do that. As far as I'm concerned this bug resides in powerbi or maybe an underlying technology that you are using to write html to the clipboard.

It would be nice if this would get fixed. Otherwise I'm not able to provide this specific feature of my service to Firefox users.

Status: New
Comments
v-chuncz-msft
Community Support

@UliPlabst 

 

For applications with limited support for pasting HTML-formatted content from the clipboard, you may share feedback via Ideas to help improve Power BI.

UliPlabst
Regular Visitor

@v-chuncz-msft

Ok I will post there. Just FYI the bug also persists in powerbi service when open in Firefox. Have a look at this gif where I perform the following steps:

1) In powerbi desktop copy a Query to clipboard

2) Go to powerbi service dataflow UI in Google Chrome and paste the query, works perfectly

3) Go to powerbi service dataflow UI in Firefox and paste the query, an error is displayed (because of the same bug I mentioned in my original post)

So the Issue does not only affect my application in Firefox but also your own applicationClipbard-Problem-PowerBI.gif

UliPlabst
Regular Visitor
v-chuncz-msft
Community Support

@UliPlabst 

 

The issue is reported internally and I will keep you posted with any updates.

CRI 228276198

v-chuncz-msft
Community Support

@UliPlabst 

 

We’ve identified the issue and you may check it again in April.

UliPlabst
Regular Visitor

@v-chuncz-msftalright, thanks.

v-chuncz-msft
Community Support

@UliPlabst 

 

As the fix involves lots of evaluation, coding and testing, there is no ETA at this time. If a user wants to copy queries from desktop, they can just use Microsoft Edge (new).