<?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 ApplyPatches - Valid Properties? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45845#M673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the ApplyPatches method of the Engine API to update a generic object (a visualization such as a combo chart).&lt;/P&gt;&lt;P&gt;I am using this method on any arbitrary set of properties of the object, but the method seems to fail for a large number of properties.&lt;/P&gt;&lt;P&gt;It is not clear which properties can be updated. The documentation here&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/EngineAPI/Content/Classes/GenericObjectClass/GenericObject-class-ApplyPatches-method.htm#NxPatch" style="font-size: 10pt;" title="https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/EngineAPI/Content/Classes/GenericObjectClass/GenericObject-class-ApplyPatches-method.htm#NxPatch"&gt;https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/EngineAPI/Content/Classes/GenericObjectClass/Generi…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Says that "some" properties can be patched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a list of patch-able properties somewhere?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 May 2018 19:34:17 GMT</pubDate>
    <dc:creator>jonvitale</dc:creator>
    <dc:date>2018-05-02T19:34:17Z</dc:date>
    <item>
      <title>ApplyPatches - Valid Properties?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45845#M673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the ApplyPatches method of the Engine API to update a generic object (a visualization such as a combo chart).&lt;/P&gt;&lt;P&gt;I am using this method on any arbitrary set of properties of the object, but the method seems to fail for a large number of properties.&lt;/P&gt;&lt;P&gt;It is not clear which properties can be updated. The documentation here&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/EngineAPI/Content/Classes/GenericObjectClass/GenericObject-class-ApplyPatches-method.htm#NxPatch" style="font-size: 10pt;" title="https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/EngineAPI/Content/Classes/GenericObjectClass/GenericObject-class-ApplyPatches-method.htm#NxPatch"&gt;https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/EngineAPI/Content/Classes/GenericObjectClass/Generi…&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Says that "some" properties can be patched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a list of patch-able properties somewhere?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2018 19:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45845#M673</guid>
      <dc:creator>jonvitale</dc:creator>
      <dc:date>2018-05-02T19:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyPatches - Valid Properties?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45846#M674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have used ApplyPatches a lot and never come across properties that cannot be patched. What happens? Do you get an error message? Or does it simply not work? It's more likely there is a format problem with your patch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you share an example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 03:48:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45846#M674</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2018-05-03T03:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyPatches - Valid Properties?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45847#M675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, this is what I did wrong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was passing a batch set of definitions to patch an object. So, I wasn't getting the individual error messages for each patch, just a broad fail. When I tried each patch individually in the API Explorer I see the problem. Basically, I am trying to patch a value in an array that does not exist (but could in theory). Here's an example with a combochart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15253528728838793 jive_text_macro" jivemacro_uid="_15253528728838793" modifiedtitle="true"&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;"handle": 4,&lt;/P&gt;
&lt;P&gt;"method": "ApplyPatches",&lt;/P&gt;
&lt;P&gt;"params": {&lt;/P&gt;
&lt;P&gt;"qPatches": [&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;"qOp": "replace",&lt;/P&gt;
&lt;P&gt;"qPath": "/qHyperCubeDef/qMeasures/1",&lt;/P&gt;
&lt;P&gt;"qValue": "{\"qLibraryId\":\"\"}"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;],&lt;/P&gt;
&lt;P&gt;"qSoftPatch": false&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error is, "&lt;SPAN style="color: #ff0000;"&gt;Illegal Array Index. Out of bounds&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, because a combo-chart &lt;EM&gt;could &lt;/EM&gt;have two measures my algorithm tries to patch it, but in this case my chart only has one measure, so the second index of the qMeasures array is not defined yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully, this is the only problem. Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 13:13:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45847#M675</guid>
      <dc:creator>jonvitale</dc:creator>
      <dc:date>2018-05-03T13:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyPatches - Valid Properties?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45848#M676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm not absolutely sure about this, but I think qOp: "add" works in most cases. I also use JSON.stringify to format the value to avoid having to escape chars etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I'm glad you use the Engine API explorer, something of a forgotten tool...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erik Wetterberg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 13:21:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45848#M676</guid>
      <dc:creator>ErikWetterberg</dc:creator>
      <dc:date>2018-05-03T13:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyPatches - Valid Properties?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45849#M677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I also noticed another problem, for future reference:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the value that needs to be patched is stored as a number, patching with a string will cause a failure.&lt;/P&gt;&lt;P&gt;So for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15253817748797088" jivemacro_uid="_15253817748797088"&gt;
&lt;P&gt;"params": {&lt;/P&gt;
&lt;P&gt;"qPatches": [&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;"qOp": "replace",&lt;/P&gt;
&lt;P&gt;"qPath": "/qHyperCubeDef/qMeasures/0/qDef/qNumFormat",&lt;/P&gt;
&lt;P&gt;"qValue": "{\"qUseThou\":\"0\"}"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;],&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The qUseThou can be 0 or 1 or true or false but "0" causes an error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2018 21:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45849#M677</guid>
      <dc:creator>jonvitale</dc:creator>
      <dc:date>2018-05-03T21:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyPatches - Valid Properties?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45850#M678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/5070"&gt;erik.wetterberg&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found another issue. Perhaps you can weigh in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say we have a path within the json for a KPI object to a key like "conditionalColoring". There are several key-value pairs inside this object. Like this (retrieved with GetFullPropertyTree, only relevant part displayed):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15254643162311213 jive_text_macro" jivemacro_uid="_15254643162311213" modifiedtitle="true"&gt;
&lt;P&gt;"conditionalColoring": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "useConditionalColoring": false,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "singleColor": 3,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "segments": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "limits": [],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "colors": [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "color": 2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; ]&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;},&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I want to patch only one of these key-value pairs, like "singleColor", I might try this ApplyPatches method (in Engine API Explorer):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15254646577445354" jivemacro_uid="_15254646577445354" modifiedtitle="true"&gt;
&lt;P&gt;"qPatches": [&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qOp": "replace",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qPath": "/qHyperCubeDef/qMeasures/0/qDef/conditionalColoring",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "qValue": "{\"singleColor\":3}"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;],&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While this successfully replaces the "singleColor" key, it removes everything else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15254646035272240" jivemacro_uid="_15254646035272240" modifiedtitle="true"&gt;
&lt;P&gt;"conditionalColoring": {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; "singleColor": 3&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could successfully fill in all the values by specifying the full sub-tree like this in my ApplyPatches call:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15254663311103022 jive_text_macro" jivemacro_uid="_15254663311103022"&gt;
&lt;P&gt;"qPatches": [&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;"qOp": "replace",&lt;/P&gt;
&lt;P&gt;"qPath": "/qHyperCubeDef/qMeasures/0/qDef/conditionalColoring",&lt;/P&gt;
&lt;P&gt;"qValue": "{\"singleColor\":3, \"useConditionalColoring\":false, \"colors\":[{\"color\":2}]}"&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;],&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using JSON.stringify would help here, but this kind of defeats the purpose of "ApplyPatches". I don't want to have to update every value in the object, I just want to patch a single key-value pair.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 20:41:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/ApplyPatches-Valid-Properties/m-p/45850#M678</guid>
      <dc:creator>jonvitale</dc:creator>
      <dc:date>2018-05-04T20:41:10Z</dc:date>
    </item>
  </channel>
</rss>

