<?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 Field API - ClearAsync() freezes indefinitely in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-ClearAsync-freezes-indefinitely/m-p/1692850#M12617</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am iterating through 80 distinct field values and clearing and applying selections for each.&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Log.Information("Getting the report for: {0} = {1}", iteration_field, user)
Log.Information("Getting field {0}", iteration_field)
Dim f = app.GetFieldAsync(iteration_field)
f.Wait()
Log.Information("Clearing current selections...")
Dim field = f.Result
Dim r = field.ClearAsync()
r.Wait()
Log.Information("Applying selections...")
Await app.GetFieldAsync(iteration_field).Result.SelectAsync(user, True)
Log.Information("Selections for the current export are: ")
Dim currentSelection = Await app.GetCurrentSelectionAsync()
For Each selectedField In currentSelection.Layout.SelectionObject.Selections
Log.Information("Camp: " &amp;amp; selectedField.Field)
Log.Information("Valori selectate: " &amp;amp; selectedField.Selected)
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The execution always freezes here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Dim f = app.GetFieldAsync(iteration_field)
f.Wait()
Dim field = f.Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But it does that in a strange way. In the first run, it freezes after 15 to 20 selections. Then at the second run goes on for 10 more GetField / Clear cycles. And so on until it finishes all. At each subsequent run, it runs very fast until the last freezing point, then it starts running slowly until eventually, invariably, freezes again at some random point.&lt;/P&gt;&lt;P&gt;The resources ( RAM / CPU ) are within normal limits.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea of why is this occurring? Any guidance will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;C&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:42:41 GMT</pubDate>
    <dc:creator>catalin</dc:creator>
    <dc:date>2024-11-16T02:42:41Z</dc:date>
    <item>
      <title>Field API - ClearAsync() freezes indefinitely</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-ClearAsync-freezes-indefinitely/m-p/1692850#M12617</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am iterating through 80 distinct field values and clearing and applying selections for each.&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Log.Information("Getting the report for: {0} = {1}", iteration_field, user)
Log.Information("Getting field {0}", iteration_field)
Dim f = app.GetFieldAsync(iteration_field)
f.Wait()
Log.Information("Clearing current selections...")
Dim field = f.Result
Dim r = field.ClearAsync()
r.Wait()
Log.Information("Applying selections...")
Await app.GetFieldAsync(iteration_field).Result.SelectAsync(user, True)
Log.Information("Selections for the current export are: ")
Dim currentSelection = Await app.GetCurrentSelectionAsync()
For Each selectedField In currentSelection.Layout.SelectionObject.Selections
Log.Information("Camp: " &amp;amp; selectedField.Field)
Log.Information("Valori selectate: " &amp;amp; selectedField.Selected)
Next&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The execution always freezes here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;Dim f = app.GetFieldAsync(iteration_field)
f.Wait()
Dim field = f.Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But it does that in a strange way. In the first run, it freezes after 15 to 20 selections. Then at the second run goes on for 10 more GetField / Clear cycles. And so on until it finishes all. At each subsequent run, it runs very fast until the last freezing point, then it starts running slowly until eventually, invariably, freezes again at some random point.&lt;/P&gt;&lt;P&gt;The resources ( RAM / CPU ) are within normal limits.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea of why is this occurring? Any guidance will be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;C&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Field-API-ClearAsync-freezes-indefinitely/m-p/1692850#M12617</guid>
      <dc:creator>catalin</dc:creator>
      <dc:date>2024-11-16T02:42:41Z</dc:date>
    </item>
  </channel>
</rss>

