<?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 Check for null response from API in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Check-for-null-response-from-API/m-p/2369971#M133067</link>
    <description>&lt;P&gt;I would like to be able to check the response of an API call and document that the result was null&lt;/P&gt;&lt;P&gt;I currently have a job that reads a series of API parameters from a database and does separate API calls for each set. Most of them work but if there is no data for that day from the vendor the API just returns a null which causes an error in the translation. I would like to be able to make a condition that would read before the error and allow me to write into a separate DB table that it came back with no results and return to the calling process for the next set.&lt;/P&gt;&lt;P&gt;I currently have a tDBInput --&amp;gt; tFlowTolerate --&amp;gt; tRunJob that calls the API process tRestClient --&amp;gt; tExtractJsonFields --&amp;gt; tdbOutput which runs but I do get an error when trying to translate the API calls that return nulls.&lt;/P&gt;&lt;P&gt;Thank you for any help&lt;/P&gt;</description>
    <pubDate>Fri, 15 Nov 2024 23:39:45 GMT</pubDate>
    <dc:creator>JHayes1633008804</dc:creator>
    <dc:date>2024-11-15T23:39:45Z</dc:date>
    <item>
      <title>Check for null response from API</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Check-for-null-response-from-API/m-p/2369971#M133067</link>
      <description>&lt;P&gt;I would like to be able to check the response of an API call and document that the result was null&lt;/P&gt;&lt;P&gt;I currently have a job that reads a series of API parameters from a database and does separate API calls for each set. Most of them work but if there is no data for that day from the vendor the API just returns a null which causes an error in the translation. I would like to be able to make a condition that would read before the error and allow me to write into a separate DB table that it came back with no results and return to the calling process for the next set.&lt;/P&gt;&lt;P&gt;I currently have a tDBInput --&amp;gt; tFlowTolerate --&amp;gt; tRunJob that calls the API process tRestClient --&amp;gt; tExtractJsonFields --&amp;gt; tdbOutput which runs but I do get an error when trying to translate the API calls that return nulls.&lt;/P&gt;&lt;P&gt;Thank you for any help&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:39:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Check-for-null-response-from-API/m-p/2369971#M133067</guid>
      <dc:creator>JHayes1633008804</dc:creator>
      <dc:date>2024-11-15T23:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: Check for null response from API</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Check-for-null-response-from-API/m-p/2369972#M133068</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;Which step  throws the error? tDBOutput? If so,  you can change the child job as below:&lt;/P&gt;&lt;P&gt;tRestClient --&amp;gt; tExtractJsonFields --&amp;gt; tJavaFelx--tHashOutput1(cache the records into memory)&lt;/P&gt;&lt;P&gt;--runIf--tHashInput1--main--&amp;gt;tdbOutput&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;on tJavaFlex: &lt;/P&gt;&lt;P&gt;begin part:&lt;/P&gt;&lt;P&gt;int counter=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;main part:&lt;/P&gt;&lt;P&gt;counter++;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;end part:&lt;/P&gt;&lt;P&gt;globalMap.put("keyName",counter);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set the condition of runIf as:&lt;/P&gt;&lt;P&gt;(Integer)globalMap.get("keyName")&amp;gt;0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in this job, use a runIf connector to trigger next process based on the condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2021 03:00:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Check-for-null-response-from-API/m-p/2369972#M133068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-08T03:00:25Z</dc:date>
    </item>
  </channel>
</rss>

