<?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 Passing the Field Selection into the Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107578#M635443</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an Stored procedure in My SQL Server which I want to execute in Qlikview , I need to pass the value to the stored procedure by selecting on the field in Qlikview&amp;nbsp; upon which I need to reload the data to get the values returned by the proc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL EXEC Proc_Name '$(vSL)','$(vEL)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vStartLocation= getFieldSelection(Source Name)&lt;/P&gt;&lt;P&gt;vEndLocationL = GetFieldSelection(Destination Name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vSL= $(vStartLocation);&lt;/P&gt;&lt;P&gt;LET vEL = $(vEndLocation);&lt;/P&gt;&lt;P&gt;the values vStartLocation and vEndLocation are declared in the variable overview and vEL and vSL are declared in the script, but the problem it is not passing the values into the variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jun 2016 09:36:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-06-14T09:36:12Z</dc:date>
    <item>
      <title>Passing the Field Selection into the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107578#M635443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an Stored procedure in My SQL Server which I want to execute in Qlikview , I need to pass the value to the stored procedure by selecting on the field in Qlikview&amp;nbsp; upon which I need to reload the data to get the values returned by the proc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL EXEC Proc_Name '$(vSL)','$(vEL)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vStartLocation= getFieldSelection(Source Name)&lt;/P&gt;&lt;P&gt;vEndLocationL = GetFieldSelection(Destination Name)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vSL= $(vStartLocation);&lt;/P&gt;&lt;P&gt;LET vEL = $(vEndLocation);&lt;/P&gt;&lt;P&gt;the values vStartLocation and vEndLocation are declared in the variable overview and vEL and vSL are declared in the script, but the problem it is not passing the values into the variables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 09:36:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107578#M635443</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-14T09:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Passing the Field Selection into the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107579#M635444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GetFieldSelection() can't be executed in the script context.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try creating a trigger OnSelect for fields Source and Destination Name in the front end (settings - document properties - triggers) and use an External - Set Variable action to copy the selection value to a variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 13:04:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107579#M635444</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-14T13:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Passing the Field Selection into the Script</title>
      <link>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107580#M635445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi vivek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot use GetFieldSelections on Script, but you can use Vars on Script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Script:&lt;/P&gt;&lt;P&gt;IF Len('$(vSL)')&amp;gt;1 and Len('$(vEL)')&amp;gt;1 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL EXEC Proc_Name '$(vSL)','$(vEL)';&lt;/P&gt;&lt;P&gt;END IF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On design:&lt;/P&gt;&lt;P&gt;Create one action on Field Triggers, on each field, on document properties.&lt;/P&gt;&lt;P&gt;Source Name field -&amp;gt; Set Variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vSL -&amp;gt; =If(GetSelectedCount([Source Name])=1,[Source Name],' ')&lt;/P&gt;&lt;P&gt;Destination Name field -&amp;gt; Set Variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vEL -&amp;gt; =If(GetSelectedCount([Destination Name])=1,[Destination Name],' ')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a button with Show Condition:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF(GetSelectedCount([Source Name])=1 and GetSelectedCount([Destination Name])=1,True(),False())&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This button may have one action, External -&amp;gt; Reload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 15:07:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Passing-the-Field-Selection-into-the-Script/m-p/1107580#M635445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-14T15:07:28Z</dc:date>
    </item>
  </channel>
</rss>

