<?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 adding parameters to function call in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816067#M15113</link>
    <description>&lt;P&gt;hi,&amp;nbsp; im creating an extension and it is working fine.&amp;nbsp; all my code is in one js file (main file) i wish to separate out the helper functions in a different js file.&amp;nbsp; for functions that dont require parameters i used the following format:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define( [], function () {
	'use strict';
	...
    return ...
});&lt;/LI-CODE&gt;&lt;P&gt;and it is working great.&amp;nbsp; now i wish to create a js file with a function that requires a parameter.&amp;nbsp; how do i code the js file?&amp;nbsp;&lt;/P&gt;&lt;P&gt;where do i insert the params?&amp;nbsp; if i do the following it wont work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define( [], function (param1, param2) {
	'use strict';
	...
    return ...
});&lt;/LI-CODE&gt;&lt;P&gt;thanks&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Jun 2021 12:36:48 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2021-06-18T12:36:48Z</dc:date>
    <item>
      <title>adding parameters to function call</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816067#M15113</link>
      <description>&lt;P&gt;hi,&amp;nbsp; im creating an extension and it is working fine.&amp;nbsp; all my code is in one js file (main file) i wish to separate out the helper functions in a different js file.&amp;nbsp; for functions that dont require parameters i used the following format:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define( [], function () {
	'use strict';
	...
    return ...
});&lt;/LI-CODE&gt;&lt;P&gt;and it is working great.&amp;nbsp; now i wish to create a js file with a function that requires a parameter.&amp;nbsp; how do i code the js file?&amp;nbsp;&lt;/P&gt;&lt;P&gt;where do i insert the params?&amp;nbsp; if i do the following it wont work:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define( [], function (param1, param2) {
	'use strict';
	...
    return ...
});&lt;/LI-CODE&gt;&lt;P&gt;thanks&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 12:36:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816067#M15113</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-18T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: adding parameters to function call</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816072#M15114</link>
      <description>&lt;P&gt;i used the following and it worked:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define( [], function () {
	'use strict';
    return function (param) { console.log(param)}
});&lt;/LI-CODE&gt;&lt;P&gt;but does this mean you can only create one function per js file?&amp;nbsp; how do you create a separate js file with all your different functions each requiring a parameter pretty much like a library?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 12:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816072#M15114</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-18T12:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: adding parameters to function call</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816096#M15116</link>
      <description>&lt;P&gt;quick and dirty test:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define( [], function () {
	'use strict';
    return {
		len: function (thisArray)   {return thisArray.length},
		sortit: function (thisArray)   {thisArray.sort(); return thisArray}
		}

});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;define(["./arrayFunctions"],
    function (arrayFunction ) {
        return {
            paint: function ($element, layout) {
			...
				var arr=[98, 18, 100, 17, 24, 34];
				console.log('arr ', arr);
				console.log('len: ', arrayFunction.len(arr))
				arrayFunction.sortit(arr)
				console.log('sorted: ',arr )

......&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1624022509242.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57095i25CB3F9D251E448E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1624022509242.png" alt="edwin_0-1624022509242.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for now this works for my purpose&lt;/P&gt;&lt;P&gt;if someone has a better way of doing this, pls share.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jun 2021 13:22:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/adding-parameters-to-function-call/m-p/1816096#M15116</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-06-18T13:22:32Z</dc:date>
    </item>
  </channel>
</rss>

