<?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 Help with GetAllVariables(callbackFn(object[])) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319004#M1240229</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks, that works! /Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jan 2012 13:30:20 GMT</pubDate>
    <dc:creator>RSvebeck</dc:creator>
    <dc:date>2012-01-31T13:30:20Z</dc:date>
    <item>
      <title>Help with GetAllVariables(callbackFn(object[]))</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319002#M1240225</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;BR /&gt;How can I write if I want the GetAllVariables(callbackFn(object[])) function to retrieve the value in a variable called "vGetColor1"?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried all sorts of things but I can not get anything to work.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The example in the API is like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt;Init = function() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; var mydoc = Qv.GetCurrentDocument();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; mydoc.GetAllVariables(function(vars) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; for (var i = 0; i &amp;lt; vars.length; i++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; var obj = vars&lt;I&gt;;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; var name = obj.name;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; var value = obj.value;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966; font-family: courier new,courier;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This works good, and will loop through all variables in my document. I have tried to write an "IF (name = "vGetColor" ...) in there, but this value seems to exist only inside the function and I can't get it stored into a global JScript variable for some strange reason...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What I'm looking for is a function something like this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;function GetValueFromVariable(VariableName).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; var mydoc = Qv.GetCurrentDocument();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; return mydoc.GetAllVariables(function(vars) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; for (var i = 0; i &amp;lt; vars.length; i++) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; var obj = vars&lt;I&gt;;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; var name = obj.name;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; var value = obj.value;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; if (name==VariableName) return value;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000; font-family: courier new,courier;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However, this does not work. All I get back from my function is "Undefined"....&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Please help me...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 16:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319002#M1240225</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2026-01-26T16:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with GetAllVariables(callbackFn(object[]))</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319003#M1240227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not know what you are trying to achieve but if your variable name is fixed you could add a Text or RefValue to your extension by adding this line in your definition.xml :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;lt;Text Initial="" Expression="=YourVariable" /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;lt;RefValue Initial="" Expression="=YourVariable" /&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you'll be able to retrieve your variable value in &lt;SPAN style="font-family: courier new,courier;"&gt;this.Layout.Text0.text&lt;/SPAN&gt; or &lt;SPAN style="font-family: courier new,courier;"&gt;this.Layout.RefValue0.value&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 13:05:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319003#M1240227</guid>
      <dc:creator />
      <dc:date>2012-01-31T13:05:57Z</dc:date>
    </item>
    <item>
      <title>Help with GetAllVariables(callbackFn(object[]))</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319004#M1240229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks, that works! /Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 13:30:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-GetAllVariables-callbackFn-object/m-p/319004#M1240229</guid>
      <dc:creator>RSvebeck</dc:creator>
      <dc:date>2012-01-31T13:30:20Z</dc:date>
    </item>
  </channel>
</rss>

