<?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 Re: We cannot convert the value &amp;quot;[Binary]&amp;quot; to type Text in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866685#M151052</link>
    <description>&lt;P&gt;You don't need to specify Method. It is sufficient to provide a content payload, that will switch We.Contents from GET to POST automatically.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2024 00:20:15 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-04-25T00:20:15Z</dc:date>
    <item>
      <title>We cannot convert the value "[Binary]" to type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866059#M151018</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get data from hubspot API to powerbi using a POST method. I'm using this code to get the data but for some reason i'm receiving this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We cannot convert the value "[Binary]" to type Text&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Details:&lt;BR /&gt;Value=[Binary]&lt;BR /&gt;Type=[Type]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let&lt;BR /&gt;data = "{'properties': [&lt;BR /&gt;'hs_survey_type'&lt;BR /&gt;],&lt;BR /&gt;'filterGroups':[{&lt;BR /&gt;&lt;BR /&gt;'filters':[&lt;BR /&gt;{&lt;BR /&gt;'propertyName':'hs_createdate',&lt;BR /&gt;'operator':'BETWEEN',&lt;BR /&gt;'highValue': '1705552000000',&lt;BR /&gt;'value':'1704064000000'&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;'propertyName':'hs_survey_type',&lt;BR /&gt;'operator':'EQ',&lt;BR /&gt;'value':'CSAT'&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}",&lt;BR /&gt;baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",&lt;BR /&gt;initReq = Json.Document(Web.Contents(baseuri, [Headers = [Authorization="Bearer HERE_THE_TOKEN", #"Content-Type"="application/json", Content= Json.FromValue(data)]])),&lt;BR /&gt;&lt;BR /&gt;initData = initReq[results]&lt;BR /&gt;&lt;BR /&gt;in&lt;BR /&gt;initData&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What might i am doing wrong?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 16:14:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866059#M151018</guid>
      <dc:creator>jumercor</dc:creator>
      <dc:date>2024-04-24T16:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: We cannot convert the value "[Binary]" to type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866605#M151042</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="731318" data-lia-user-login="jumercor" class="lia-mention lia-mention-user"&gt;jumercor&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;let
    data = "{'properties': [
    'hs_survey_type'
    ],
    'filterGroups':[{
    'filters':[
    {
        'propertyName':'hs_createdate',
        'operator':'BETWEEN',
        'highValue': '1705552000000',
        'value':'1704064000000'
    },
    {
        'propertyName':'hs_survey_type',
        'operator':'EQ',
        'value':'CSAT'
    }
    ]
    }
    ]}",
    baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",
    
    content = Json.FromValue(Text.FromBinary(data)),
    headers = [
        Authorization="Bearer HERE_THE_TOKEN",
        #"Content-Type"="application/json"
    ],
    response = Web.Contents(baseuri, [
        Content=content,
        Headers=headers,
        Method="POST"
    ]),
    
    responseText = Text.FromBinary(response),
    
    initReq = Json.Document(responseText),
    initData = initReq[results]
in
    initData
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Apr 2024 21:46:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866605#M151042</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-04-24T21:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: We cannot convert the value "[Binary]" to type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866618#M151045</link>
      <description>&lt;P&gt;Thanks, but I'm receiving -&amp;gt; Expression.Error: "Method" is not a valid option for Web.Contents. Valid options:&lt;/P&gt;&lt;P&gt;ApiKeyName, Content, ExcludedFromCacheKey, Headers, IsRetry, ManualStatusHandling, Query, RelativePath, Timeout&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2024 21:56:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866618#M151045</guid>
      <dc:creator>jumercor</dc:creator>
      <dc:date>2024-04-24T21:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: We cannot convert the value "[Binary]" to type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866685#M151052</link>
      <description>&lt;P&gt;You don't need to specify Method. It is sufficient to provide a content payload, that will switch We.Contents from GET to POST automatically.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 00:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3866685#M151052</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-25T00:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: We cannot convert the value "[Binary]" to type Text</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3868691#M151131</link>
      <description>&lt;P&gt;Thanks everyone, I solved it by myself. Here you can check the final solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;let&lt;BR /&gt;data = "{""properties"":[""hs_survey_type""],""filterGroups"":[{""filters"":[{""propertyName"":""hs_createdate"",""operator"":""BETWEEN"",""highValue"":""1705552000000"",""value"":""1704064000000""},{""propertyName"":""hs_survey_type"",""operator"":""EQ"",""value"":""CSAT""}]}]}",&lt;BR /&gt;baseuri = "https://api.hubapi.com/crm/v3/objects/feedback_submissions/search",&lt;BR /&gt;initReq = Json.Document(Web.Contents(baseuri, [&lt;BR /&gt;Headers = [&lt;BR /&gt;Authorization="Bearer HERE_THE_TOKEN",&lt;BR /&gt;#"Content-Type"="application/json"&lt;BR /&gt;],&lt;BR /&gt;Content=Text.ToBinary(data)&lt;BR /&gt;])),&lt;BR /&gt;initData = initReq[results]&lt;BR /&gt;in&lt;BR /&gt;initData&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I moved 'Content' into web.contents parameters, and also I reformated 'data' from a text o a binary using Text.ToBinary&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 14:32:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/We-cannot-convert-the-value-quot-Binary-quot-to-type-Text/m-p/3868691#M151131</guid>
      <dc:creator>jumercor</dc:creator>
      <dc:date>2024-04-25T14:32:38Z</dc:date>
    </item>
  </channel>
</rss>

