<?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: Need help with list operation in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11546#M4435</link>
    <description>&lt;P&gt;I've never found a simple solution for this problem, so I use a Ruby action with this code to recursively remove null/blank keys. Hopefully someone has a native or better way of doing this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;def deep_compact(obj)
  case obj
  when Hash
    obj.each_with_object({}) do |(k, v), h|
      cleaned = deep_compact(v)
      h[k] = cleaned unless cleaned.nil? || cleaned == ""
    end
  when Array
    obj.map { |v| deep_compact(v) }.reject { |v| v.nil? || v == "" }
  else
    obj
  end
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jan 2026 17:27:01 GMT</pubDate>
    <dc:creator>gary1</dc:creator>
    <dc:date>2026-01-06T17:27:01Z</dc:date>
    <item>
      <title>Need help with list operation</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11544#M4434</link>
      <description>&lt;P&gt;Currently I am trying to map&amp;nbsp; list&amp;nbsp; items&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-01-06 182121.png" style="width: 999px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2495i470B951E04B486C8/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-01-06 182121.png" alt="Screenshot 2026-01-06 182121.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, when the entire list has no data, the output is generated in the following format:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt; &lt;SPAN class=""&gt;"list"&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;[&lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt; &lt;SPAN class=""&gt;}&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;However, if the list is completely empty, I don’t want the array to appear at all in the output payload. The list field should be entirely omitted, with no empty objects or placeholders included.&lt;/P&gt;&lt;P&gt;Is there a workaround to conditionally exclude this field from the output when no data is present?&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Jan 2026 12:54:26 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11544#M4434</guid>
      <dc:creator>Bhagya_pola</dc:creator>
      <dc:date>2026-01-06T12:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with list operation</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11546#M4435</link>
      <description>&lt;P&gt;I've never found a simple solution for this problem, so I use a Ruby action with this code to recursively remove null/blank keys. Hopefully someone has a native or better way of doing this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;def deep_compact(obj)
  case obj
  when Hash
    obj.each_with_object({}) do |(k, v), h|
      cleaned = deep_compact(v)
      h[k] = cleaned unless cleaned.nil? || cleaned == ""
    end
  when Array
    obj.map { |v| deep_compact(v) }.reject { |v| v.nil? || v == "" }
  else
    obj
  end
end&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jan 2026 17:27:01 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11546#M4435</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-01-06T17:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with list operation</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11553#M4436</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/1188"&gt;@gary1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;For ease of explanation, I have shown CDM here however, the actual scenario deals with SAP RFC – Send IDoc. CDM in this context refers to the SAP IDoc structure only and is used purely for representation. There is no downstream processing involved everything required must be handled entirely within the SAP step.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 13:31:33 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11553#M4436</guid>
      <dc:creator>Bhagya_pola</dc:creator>
      <dc:date>2026-01-07T13:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with list operation</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11556#M4437</link>
      <description>&lt;P&gt;I don't think you can solve this issue in the input of the SAP step. You need to pre-process the data to remove the empty objects from the array (using the Ruby I provided) and then map the output of the Ruby action into the input of SAP step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't guarantee this will work for your exact situation, but it has worked for me in similar situations before.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jan 2026 18:36:32 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11556#M4437</guid>
      <dc:creator>gary1</dc:creator>
      <dc:date>2026-01-07T18:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with list operation</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11578#M4445</link>
      <description>&lt;P&gt;Hi, before populating the structure as you showed, you could add an "if" condition (new action) to check for array size &amp;gt; 0 and after then add a var list (new action) that populates the structure as a dynamic list.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jan 2026 08:49:32 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11578#M4445</guid>
      <dc:creator>francbaviello</dc:creator>
      <dc:date>2026-01-14T08:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with list operation</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11605#M4458</link>
      <description>&lt;P&gt;Use Compact method to remove the empty arrays&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 05:03:35 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/need-help-with-list-operation/m-p/11605#M4458</guid>
      <dc:creator>Nadella_Rajesh</dc:creator>
      <dc:date>2026-01-20T05:03:35Z</dc:date>
    </item>
  </channel>
</rss>

