<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Suggestion on mapping Integration response</title><link>https://community.appian.com/discussions/f/integrations/39175/suggestion-on-mapping-integration-response</link><description>I am getting the below response from Integration which is of type HttpResponse 
 [statusLine=HTTP/1.1 200 OK, statusCode=200, headers=[object Object], contentType=application/json; charset=utf-8, body={&amp;quot;jobId&amp;quot;:&amp;quot;01091664F27E4771A9B92AEA0CC577ED&amp;quot;}]. 
 I</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148482?ContentTypeID=1</link><pubDate>Thu, 29 May 2025 12:00:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07da0e26-f4cd-431a-83de-66bd3cbb0e14</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;great, thanks for confirning - would appreciate a &amp;#39;verify&amp;#39; if/when you get a chance, too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148467?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 22:51:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:593cf322-aad6-401e-a4fc-c36b02a76822</guid><dc:creator>poojithak2926</dc:creator><description>&lt;p&gt;i tried this it did not work&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148466?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 22:50:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:768f8bd9-c630-490a-a9fb-317ac5c4edea</guid><dc:creator>poojithak2926</dc:creator><description>&lt;p&gt;Wow! Thanks a lot for this explanation&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;.Considering&amp;nbsp;your suggestions i have build the below code and its working in all possible conditions.&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!body: if(&lt;br /&gt; a!isNotNullOrEmpty(ri!integrationResponse),&lt;br /&gt; a!fromJson(&lt;br /&gt; index(ri!integrationResponse, &amp;quot;body&amp;quot;, null)&lt;br /&gt; ),&lt;br /&gt; {}&lt;br /&gt; ),&lt;br /&gt; {&lt;br /&gt; if(&lt;br /&gt; a!isNotNullOrEmpty(local!body),&lt;br /&gt; property(local!body, &amp;quot;jobId&amp;quot;, null()),&lt;br /&gt; {}&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148456?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 14:16:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9dd99478-532d-4c07-bf17-9af48ff20c3f</guid><dc:creator>gayathrik6397</dc:creator><description>&lt;p&gt;Good explanation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148450?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 12:25:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cd2fec58-0b6f-4eca-aa60-3229d30efc3c</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You need to step through this piece by piece to understand what&amp;#39;s actually going on.&lt;/p&gt;
&lt;p&gt;Firstly we can see that the &amp;quot;body&amp;quot; you&amp;#39;re getting back is a JSON string (I can see you&amp;#39;re already trying to treat it as JSON but just reiterating here for clarity).&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/18/pastedimage1748434595040v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So when &amp;quot;body&amp;quot; is populated, we will want to translate it back from JSON, which of course results in a dictionary:&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/18/pastedimage1748434684103v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Now of course, as with all dictionaries/CDTs/maps, if we want only the property within the dictionary, we actually have to retrieve the value of that property (Even when the entire dictionary only holds one property).&amp;nbsp; For this, dot property would work, but if there&amp;#39;s ever a chance it would be empty, it would be safer to use &lt;em&gt;&lt;strong&gt;property()&lt;/strong&gt;&lt;/em&gt;.&amp;nbsp; (Note as always: property() and index() are the same function in the back-end; but my personal best practice is to use property() for properties, and index() for indices [i.e. positional within an array], for code cleanliness and readability).&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/18/pastedimage1748434833068v4.png" alt=" " /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/18/pastedimage1748434868284v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Side note: if you&amp;#39;re passing the &amp;quot;body&amp;quot; value directly into a!fromJson(), then your null-safe returned value should be something that doesn&amp;#39;t cause a!fromJson() to crash - I&amp;#39;ve found &amp;quot;[]&amp;quot; or &amp;quot;{}&amp;quot; work well.&amp;nbsp; It will error on you if you pass it null().&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/18/pastedimage1748435068283v6.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148448?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 08:06:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2982f56f-7cea-4f3e-b877-3b20fdb39233</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;You need to add one more index if you want to recover jobId value from the response.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;index(&lt;span&gt;index(ri!integrationResponse, &amp;quot;body&amp;quot;, null), &amp;quot;jobId&amp;quot;, null)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148445?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 06:01:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bca7db97-a4d8-4c40-a991-3241a3334b1d</guid><dc:creator>sarathkumar13</dc:creator><description>&lt;p&gt;Please try the below code&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;index(index(ri!integrationResponse, &amp;quot;body&amp;quot;, &amp;quot;&amp;quot;), &amp;quot;jobId&amp;quot;, &amp;quot;&amp;quot;)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148444?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 05:57:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0478b1bd-e56a-4846-9879-d727aecffa4b</guid><dc:creator>VarunTejaGurrapu</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/poojithak2926"&gt;poojithak2926&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;I would suggest you to create a rule and use the integration in the following way:&lt;br /&gt;&lt;br /&gt;rule!ABC_FormatData(ri!response :&amp;nbsp;&lt;span&gt;ri!integrationResponse)&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: split(
    index(
      ri!response,
      &amp;quot;body&amp;quot;,
      {}
    ),
    &amp;quot;:&amp;quot;
  ),
  local!jobId:index(local!data, 2, {}),
  left(local!jobId,count(char(code(local!jobId)))-1)
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Suggestion on mapping Integration response</title><link>https://community.appian.com/thread/148441?ContentTypeID=1</link><pubDate>Wed, 28 May 2025 05:47:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:279c94d0-de9f-477e-a00e-5bfe93681adc</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Did you try this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if(
a!isNotNullOrEmpty(ri!integrationResponse),
a!fromJson(
index(ri!integrationResponse, &amp;quot;body&amp;quot;,&amp;quot;jobId&amp;quot; null),
),
{}
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>