<?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 wait for callback function with getlist in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/wait-for-callback-function-with-getlist/m-p/1820351#M15212</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;With little to no exprerience in JS i am trying to create a mashup to export master items from my apps as csv.&lt;BR /&gt;For that I am using something like, for example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var strTest = "";

qApp.getList("DimensionList", function(reply){
$.each(reply.qDimensionList.qItems, function(key, value) {
strTest = strTest + '"' +
value.qInfo.qId + '";"' +
value.qMeta.title + '";"' +
value.qData.info[0].qName + '";"' +
value.qMeta.createdDate + '";"' +
value.qMeta.modifiedDate + '";"' +
value.qMeta.owner.userId + '";"' +
value.qMeta.description + '";"' +
value.qData.labelExpression + '";"' +
'' + '";"' +
'Dimension' + '"' + '\n';
});
});

/*
Export strTest instructions...
*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I also want to append to strTest the same thing for measures.&lt;BR /&gt;This works but the callback function is only run when data is received (a couple of seconds after my csv download instruction) , so I end up with an empty csv.&lt;/P&gt;&lt;P&gt;Could you tell me how I can adapt my code to wait for the callback function to run before exporting.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jul 2021 11:13:21 GMT</pubDate>
    <dc:creator>frheblou</dc:creator>
    <dc:date>2021-07-07T11:13:21Z</dc:date>
    <item>
      <title>wait for callback function with getlist</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/wait-for-callback-function-with-getlist/m-p/1820351#M15212</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;With little to no exprerience in JS i am trying to create a mashup to export master items from my apps as csv.&lt;BR /&gt;For that I am using something like, for example :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var strTest = "";

qApp.getList("DimensionList", function(reply){
$.each(reply.qDimensionList.qItems, function(key, value) {
strTest = strTest + '"' +
value.qInfo.qId + '";"' +
value.qMeta.title + '";"' +
value.qData.info[0].qName + '";"' +
value.qMeta.createdDate + '";"' +
value.qMeta.modifiedDate + '";"' +
value.qMeta.owner.userId + '";"' +
value.qMeta.description + '";"' +
value.qData.labelExpression + '";"' +
'' + '";"' +
'Dimension' + '"' + '\n';
});
});

/*
Export strTest instructions...
*/&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I also want to append to strTest the same thing for measures.&lt;BR /&gt;This works but the callback function is only run when data is received (a couple of seconds after my csv download instruction) , so I end up with an empty csv.&lt;/P&gt;&lt;P&gt;Could you tell me how I can adapt my code to wait for the callback function to run before exporting.&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jul 2021 11:13:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/wait-for-callback-function-with-getlist/m-p/1820351#M15212</guid>
      <dc:creator>frheblou</dc:creator>
      <dc:date>2021-07-07T11:13:21Z</dc:date>
    </item>
  </channel>
</rss>

