<?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: How to exclude xml tags when value is null while handling xml requests in SDK Connector in Workato Pros Discussion Board</title>
    <link>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5985#M2631</link>
    <description>&lt;P&gt;Thanks Chris!! It worked pretty well&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jan 2024 17:22:11 GMT</pubDate>
    <dc:creator>ricardomatsumot</dc:creator>
    <dc:date>2024-01-18T17:22:11Z</dc:date>
    <item>
      <title>How to exclude xml tags when value is null while handling xml requests in SDK Connector</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5982#M2628</link>
      <description>&lt;P&gt;Hi, I am building a SDK Connector that calls an API with XML payload.&lt;/P&gt;&lt;P&gt;I am following the &lt;A href="https://docs.workato.com/developing-connectors/sdk/guides/data-formats/xml-format.html#forming-xml-payload-in-request" target="_blank" rel="noopener"&gt;Handling XML documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, I want to know how I can exclude the xml tag whenever the input value is not provided. Is there a way we can do that?&lt;/P&gt;&lt;P&gt;For example, I have 2 optional input fields: &lt;STRONG&gt;key1&lt;/STRONG&gt; and &lt;STRONG&gt;key2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And I am using this code to create the xml payload&lt;/P&gt;&lt;PRE&gt;"content": [&lt;BR /&gt;  {&lt;BR /&gt;    "data1": [{ "content!": input["key1"] }],&lt;BR /&gt;    "data2": [{ "content!": input["key2"] }]&lt;BR /&gt;  }&lt;BR /&gt;]&lt;/PRE&gt;&lt;P&gt;And I am expecting to get this xml&lt;/P&gt;&lt;PRE&gt;&amp;lt;content&amp;gt;&lt;BR /&gt;  &amp;lt;data1&amp;gt;key1Value&amp;lt;/data1&amp;gt;&lt;BR /&gt;  &amp;lt;data2&amp;gt;key2Value&amp;lt;/data1&amp;gt;&lt;BR /&gt;&amp;lt;content&amp;gt;&lt;/PRE&gt;&lt;P&gt;However, when the input for key2 is not provided, I want to get this xml:&lt;/P&gt;&lt;PRE&gt;&amp;lt;content&amp;gt;&lt;BR /&gt;  &amp;lt;data1&amp;gt;key1Value&amp;lt;/data1&amp;gt;&lt;BR /&gt;&amp;lt;content&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 13:57:42 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5982#M2628</guid>
      <dc:creator>ricardomatsumot</dc:creator>
      <dc:date>2024-01-18T13:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude xml tags when value is null while handling xml requests in SDK Connector</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5984#M2630</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://systematic.workato.com/t5/user/viewprofilepage/user-id/9934"&gt;@ricardomatsumot&lt;/a&gt;,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You need to build your structure with some conditions before converting it into XML. For example like this.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;object = {}&lt;BR /&gt;object['data1'] = _input['key1'] if _input['key1'].present?&lt;BR /&gt;object['data2'] = _input['key2'] if _input['key2'].present?&lt;/PRE&gt;&lt;P&gt;Hope this helps you!&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 16:48:41 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5984#M2630</guid>
      <dc:creator>chris-wiechmann</dc:creator>
      <dc:date>2024-01-18T16:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude xml tags when value is null while handling xml requests in SDK Connector</title>
      <link>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5985#M2631</link>
      <description>&lt;P&gt;Thanks Chris!! It worked pretty well&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 17:22:11 GMT</pubDate>
      <guid>https://systematic.workato.com/t5/workato-pros-discussion-board/how-to-exclude-xml-tags-when-value-is-null-while-handling-xml/m-p/5985#M2631</guid>
      <dc:creator>ricardomatsumot</dc:creator>
      <dc:date>2024-01-18T17:22:11Z</dc:date>
    </item>
  </channel>
</rss>

