<?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: Qlik Sense: Update a variable via API in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022891#M4103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When are you trying to update the definition of the variable? You can only do that before the application is published? Are you doing this on Qlik Sense Desktop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the documentation here to see how to create variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/sense/2.1/en-US/developer/Subsystems/NetSDKAPI/Content/WorkWith/Net-Sdk-Work-With-Variables.htm" title="https://help.qlik.com/sense/2.1/en-US/developer/Subsystems/NetSDKAPI/Content/WorkWith/Net-Sdk-Work-With-Variables.htm"&gt;https://help.qlik.com/sense/2.1/en-US/developer/Subsystems/NetSDKAPI/Content/WorkWith/Net-Sdk-Work-With-Variables.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Feb 2016 08:43:37 GMT</pubDate>
    <dc:creator>petter</dc:creator>
    <dc:date>2016-02-16T08:43:37Z</dc:date>
    <item>
      <title>Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022888#M4100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to update a variable Definition using the NET SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I loaded all the variables using the client as follows (I don't know if there's a better way):&lt;/P&gt;&lt;P&gt;Qlik.Sense.Client.IVariableList variables = Qlik.Sense.Client.AppExtensions.GetVariableList(qsApp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then try to change the values using:&lt;/P&gt;&lt;P&gt;qsVariable.Set&amp;lt;string&amp;gt;("Definition", kpv.Value.Definition);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am lost as to which API has the information and the actions I would need to do to achieve what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2016 12:11:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022888#M4100</guid>
      <dc:creator />
      <dc:date>2016-02-12T12:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022889#M4101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't show in your snippets above how you define and set the reference in the qsVariable. Furthermore I can see that I find a Method called Set - have a look at this list of methods:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/sense/2.1/en-US/developer/#../Subsystems/APIs/Content/MashupAPI/qlik-variable-interface.htm%3FTocPath%3DQlik%2520Sense%2520APIs%2520and%2520SDKs%7CCapability%2520APIs%7Cqlik.app.variable%2520(Variable%2520API)%7C_____0" title="https://help.qlik.com/sense/2.1/en-US/developer/#../Subsystems/APIs/Content/MashupAPI/qlik-variable-interface.htm%3FTocPath%3DQlik%2520Sense%2520APIs%2520and%2520SDKs%7CCapability%2520APIs%7Cqlik.app.variable%2520(Variable%2520API)%7C_____0"&gt;https://help.qlik.com/sense/2.1/en-US/developer/#../Subsystems/APIs/Content/MashupAPI/qlik-variable-interface.htm%3FTocP…&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Feb 2016 23:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022889#M4101</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-15T23:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022890#M4102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a dictionary as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (pVariables != null &amp;amp;&amp;amp; pVariables.Count &amp;gt; 0) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (KeyValuePair&amp;lt;string, NxVariableListItem&amp;gt; kpv in pVariables) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NxVariableListItem qsVariable = kpv.Value;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried the following:&lt;/P&gt;&lt;P&gt;qsVariable.Set&amp;lt;string&amp;gt;("Definition", kpv.Value.Definition);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GenericVariable tmp = qsApp.GetVariableByName(kpv.Value.Name);&lt;/P&gt;&lt;P&gt;GenericVariableProperties tmpp = tmp.GetProperties();&lt;/P&gt;&lt;P&gt;tmpp.Set&amp;lt;string&amp;gt;("Definition", kpv.Value.Definition);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neither works...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 06:18:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022890#M4102</guid>
      <dc:creator />
      <dc:date>2016-02-16T06:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022891#M4103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When are you trying to update the definition of the variable? You can only do that before the application is published? Are you doing this on Qlik Sense Desktop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the documentation here to see how to create variables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.qlik.com/sense/2.1/en-US/developer/Subsystems/NetSDKAPI/Content/WorkWith/Net-Sdk-Work-With-Variables.htm" title="https://help.qlik.com/sense/2.1/en-US/developer/Subsystems/NetSDKAPI/Content/WorkWith/Net-Sdk-Work-With-Variables.htm"&gt;https://help.qlik.com/sense/2.1/en-US/developer/Subsystems/NetSDKAPI/Content/WorkWith/Net-Sdk-Work-With-Variables.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 08:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022891#M4103</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2016-02-16T08:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022892#M4104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm (trying to) updating the variables in the qvf file locally before publishing the file in QS Server via the API.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have looked at the examples provided. Does that mean that I should destroy the variables I want to update and create again? Seems odd!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI, I am able to update Connections correctly before publish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Feb 2016 09:03:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022892#M4104</guid>
      <dc:creator />
      <dc:date>2016-02-16T09:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022893#M4105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would assume you would need to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;GenericVariable tmp = qsApp.GetVariableByName(kpv.Value.Name);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;GenericVariableProperties tmpp = tmp.GetProperties();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;tmpp.Definition = kpv.Value.Definition;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;tmp.SetProperties(tmpp);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice that I do not use the generic Set method for the properties structure, but instead rely on the C# class property. Also, note that your have to do a "SetProperties" after you have modified the properties structure, otherwise the engine will never be informed that the properties has changed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 13:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022893#M4105</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2016-02-25T13:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022894#M4106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And a small note on the line with the generic "Set" method for setting the variable definition: The engine will actually look for a property named "qDefinition", not "Definition" when evaluating a variable. The C# property "Definition" of the "GenericVariableProperties" class maps to that engine property. Actually, these two operations should be equivalent in your case:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) tmpp.Definition = kpv.Value.Definition;&lt;/P&gt;&lt;P&gt;2) tmpp.Set&amp;lt;string&amp;gt;("qDefinition", kpv.Value.Definition);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the property name starts with a 'q' in version 2)! The engine uses that prefix to identify properties that are to be evaluated by the engine. (Other typical examples you will encounter are "qHyperCubeDef" and "qListObjectDef".)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2016 13:36:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022894#M4106</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2016-02-25T13:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022895#M4107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still KO!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe i'm doing something wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In fact, I have a local file.&lt;/P&gt;&lt;P&gt;1. I connect to QS and upload the file using the REST api. (qrs/app/upload?name={0})&lt;/P&gt;&lt;P&gt;2. I get the AppId and change the variables as per your previous message.&lt;/P&gt;&lt;P&gt;3. I publish/replace the file (qrs/app/{0}/publish?stream={1} or qrs/app/{0}/replace?app={1})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I check on the published app, the variable definition is unchanged...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Feb 2016 11:10:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022895#M4107</guid>
      <dc:creator />
      <dc:date>2016-02-29T11:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik Sense: Update a variable via API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022896#M4108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's now working in 2.2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Apr 2016 05:41:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Qlik-Sense-Update-a-variable-via-API/m-p/1022896#M4108</guid>
      <dc:creator />
      <dc:date>2016-04-13T05:41:33Z</dc:date>
    </item>
  </channel>
</rss>

