<?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 Re: Handling NULL values for comparison when using .where() in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12139#M4659</link>
    <description>&lt;P&gt;Hey, can post the actual JSON (or a sample) and a better screenshot of your current formula? Either the image is really pixelated or I need bifocals, maybe both.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Apr 2026 14:41:54 GMT</pubDate>
    <dc:creator>gary1</dc:creator>
    <dc:date>2026-04-30T14:41:54Z</dc:date>
    <item>
      <title>Handling NULL values for comparison when using .where()</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12137#M4658</link>
      <description>&lt;P&gt;I’m working on a solution which needs to lookup a unit price from an API call.&amp;nbsp; The JSON returned by the API call includes an array of Prices in the following format:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="200"&gt;&lt;P&gt;starting_quantity&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;ending_quantity&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;unit_price&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="200"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;100&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;9.99&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="200"&gt;&lt;P&gt;101&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;200&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;8.99&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="200"&gt;&lt;P&gt;200&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;NULL&lt;/P&gt;&lt;/TD&gt;&lt;TD width="200"&gt;&lt;P&gt;7.99&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I have a Quantity value that I want to use to lookup and return the relevant unit_price based on the “band” in which the Quantity sits.&amp;nbsp; I’m using WHERE and PLUCK to do this, and the formula is currently…&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="unit price.png" style="width: 451px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2665i014EFEF9000D0E9D/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="unit price.png" alt="unit price.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, for example, looking up Quantity values of 1, 7 or 100 would all return a unit_price of 9.99 whereas looking up 110 would return a unit_price of 8.99.&lt;/P&gt;&lt;P&gt;My problem comes when I try to lookup a value which sits in a “band” where the ending_quantity is NULL.&amp;nbsp; For example a Quantity of 201 (or greater).&lt;/P&gt;&lt;P&gt;In this scenario Workato throws an error, reporting… "Error calculating input for field 'Unit_Price': The 'ending_quantity' is nil" ...&amp;nbsp;which is indeed a true statement.&lt;/P&gt;&lt;P&gt;So, my question is how do I handle this situation?&lt;/P&gt;&lt;P&gt;This lookup routine will be invoked frequently, so minimising tasks is of the essence.&lt;/P&gt;&lt;P&gt;My current workaround is to use an additional Create List step to generate a new List, populating it with the same values as per the original Price array, but using a ternary operator when populating the ending_quantity field to substitute a NULL value with a bejllion instead (an impossibly high value in practice).&lt;/P&gt;&lt;P&gt;This only takes one extra task but it will add up over the volume of lookups expected for the initial bulk processing. (And yes I have checked that NULL in the ending_quantity is always used in the last row of such tables, to indicate an infinitely high value, rather than there being an additional alternative meaning for the use of NULL).&lt;/P&gt;&lt;P&gt;Am I missing a trick such that I can avoid this extra step and do something natively clever using WHERE?&lt;/P&gt;&lt;P&gt;Any suggestions would be appreciated...&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2026 11:26:49 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12137#M4658</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-04-30T11:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: Handling NULL values for comparison when using .where()</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12139#M4659</link>
      <description>&lt;P&gt;Hey, can post the actual JSON (or a sample) and a better screenshot of your current formula? Either the image is really pixelated or I need bifocals, maybe both.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2026 14:41:54 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12139#M4659</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-04-30T14:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Handling NULL values for comparison when using .where()</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12140#M4660</link>
      <description>&lt;P&gt;I read this over again and I don't think there's much else you can do with this approach. There's no inline substitution on reference values when using "where", so your approach to remap null to "gazillion" upstream is the best alternative. If you really want to save the task, you can drop this all into a Ruby or JS action to handle it all in one go.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2026 16:13:08 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12140#M4660</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-04-30T16:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Handling NULL values for comparison when using .where()</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12144#M4661</link>
      <description>&lt;P&gt;Hi Gary&lt;/P&gt;&lt;P&gt;Sample JSON of the array of Prices looks like this..&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Price Array Screenshot.jpg" style="width: 297px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2666i1598A5E68AB74865/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Price Array Screenshot.jpg" alt="Price Array Screenshot.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And slightly bigger screenshot of the formula looks like this...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="unit price.jpg" style="width: 942px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2668i65D20E689EB57B3F/image-dimensions/942x82/is-moderation-mode/true?v=v2" width="942" height="82" role="button" title="unit price.jpg" alt="unit price.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Appreciate your time (as always) and confirmation that there's nothing readily apparent as an alternative besides writing a code block.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Russell&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2026 16:49:29 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/handling-null-values-for-comparison-when-using-where/m-p/12144#M4661</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-04-30T16:49:29Z</dc:date>
    </item>
  </channel>
</rss>

