<?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 TIP: (Safely) Concatenating Strings that might be NULL in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/tip-safely-concatenating-strings-that-might-be-null/m-p/12171#M4671</link>
    <description>&lt;P&gt;I was today years old when I came across this simple solution so thought I'd post it!&lt;/P&gt;&lt;P&gt;I often find I want to concatenate two or more strings together, usually when trying to formulate a friendly error message for a log or an email to a human when something's not quite worked right.&lt;/P&gt;&lt;P&gt;However, you can't safely just use...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="no conv.jpg" style="width: 353px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2672i1972C45EF76643F6/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="no conv.jpg" alt="no conv.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... because if either or both values contains a NULL, Workato throws an error.&lt;/P&gt;&lt;P&gt;I started to head down the ternary operator route (which felt overly complicated and difficult to read) and then stumbled across the use of ".to_s" for each data pill to force convert the data pill to a string...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="to_s.jpg" style="width: 418px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2671i55C81E03D721315E/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="to_s.jpg" alt="to_s.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, if either value contains NULL the result is an empty string (which Workato is then happy to "squish" with another string).&lt;/P&gt;&lt;P&gt;Realise it's very basic, but thought I'd share in case someone else might find it useful.&lt;/P&gt;&lt;P&gt;Tune in next week for "Russell learns to pat his head and rub his tummy at the same time"...&lt;/P&gt;&lt;P&gt;[waits for &lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/1188"&gt;@gary1&lt;/a&gt;&amp;nbsp;&amp;nbsp;to jump in with an even better, more elegant solution...]&lt;/P&gt;</description>
    <pubDate>Fri, 08 May 2026 10:11:26 GMT</pubDate>
    <dc:creator>RussellJ</dc:creator>
    <dc:date>2026-05-08T10:11:26Z</dc:date>
    <item>
      <title>TIP: (Safely) Concatenating Strings that might be NULL</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/tip-safely-concatenating-strings-that-might-be-null/m-p/12171#M4671</link>
      <description>&lt;P&gt;I was today years old when I came across this simple solution so thought I'd post it!&lt;/P&gt;&lt;P&gt;I often find I want to concatenate two or more strings together, usually when trying to formulate a friendly error message for a log or an email to a human when something's not quite worked right.&lt;/P&gt;&lt;P&gt;However, you can't safely just use...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="no conv.jpg" style="width: 353px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2672i1972C45EF76643F6/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="no conv.jpg" alt="no conv.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;... because if either or both values contains a NULL, Workato throws an error.&lt;/P&gt;&lt;P&gt;I started to head down the ternary operator route (which felt overly complicated and difficult to read) and then stumbled across the use of ".to_s" for each data pill to force convert the data pill to a string...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="to_s.jpg" style="width: 418px;"&gt;&lt;img src="https://systematic.workato.com/t5/image/serverpage/image-id/2671i55C81E03D721315E/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="to_s.jpg" alt="to_s.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now, if either value contains NULL the result is an empty string (which Workato is then happy to "squish" with another string).&lt;/P&gt;&lt;P&gt;Realise it's very basic, but thought I'd share in case someone else might find it useful.&lt;/P&gt;&lt;P&gt;Tune in next week for "Russell learns to pat his head and rub his tummy at the same time"...&lt;/P&gt;&lt;P&gt;[waits for &lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/1188"&gt;@gary1&lt;/a&gt;&amp;nbsp;&amp;nbsp;to jump in with an even better, more elegant solution...]&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 10:11:26 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/tip-safely-concatenating-strings-that-might-be-null/m-p/12171#M4671</guid>
      <dc:creator>RussellJ</dc:creator>
      <dc:date>2026-05-08T10:11:26Z</dc:date>
    </item>
  </channel>
</rss>

