<?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>How to parse a JSON http response ?</title><link>https://community.appian.com/discussions/f/integrations/18924/how-to-parse-a-json-http-response</link><description>Hello Everybody, 
 I would like to parse a JSON http response and show only the values I&amp;#39;m interested in. I am trying with a!fromJson function but I am not able to get multiple values in the result body of the call integration to my webAPI. 
 I would</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/82920?ContentTypeID=1</link><pubDate>Thu, 24 Jun 2021 10:00:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a91393c-fdd2-48c1-894b-330ca9fe42b7</guid><dc:creator>Said BARKAM</dc:creator><description>&lt;p&gt;You can also convert the response to Appian value on the integration object&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/18/pastedimage1624528794479v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/74483?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2020 21:56:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:daba83dc-5051-4b80-8901-78752bbd276a</guid><dc:creator>legotx</dc:creator><description>&lt;p&gt;a!fromJSON will return an &amp;quot;Object&amp;quot; with no specific type. From there, you can access the values via dot notation or via index.&lt;/p&gt;
&lt;p&gt;Assuming local!weatherData is your variable that holds the response.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;with (
   /* ASSUMING RESPONSE BODY IS JSON STRING */
&amp;#160; &amp;#160;local!weatherData: a!fromJson(ri!httpResponseBody),
&amp;#160; &amp;#160;local!temperature: index(local!weatherData, &amp;quot;main&amp;quot;, &amp;quot;temp&amp;quot;, null),
&amp;#160; &amp;#160;local!pressure: index(local!weatherData, &amp;quot;main&amp;quot;, &amp;quot;pressure&amp;quot;, null),
   /* RETURNS BOTH TEMPERATURE AND PRESSURE */
&amp;#160; &amp;#160;{
&amp;#160; &amp;#160; &amp;#160;temperature: local!temperature,
&amp;#160; &amp;#160; &amp;#160;pressure: local!pressure
&amp;#160; }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/74372?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 15:35:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4b0868dc-16a5-483e-8c8d-856633467c30</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You should be able to access any of the properties in the dictionary using dot notation in the same syntax.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/74370?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 15:20:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:743e2079-f836-4be1-81fe-7e563444a146</guid><dc:creator>gonzaloa</dc:creator><description>&lt;p&gt;Thank you very much for your answer Mike. And if I want to show various values? not only the &amp;quot;temp&amp;quot;?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/74364?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 14:11:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:47faa44f-bb7f-4ef1-8409-271f50ef4e9f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Calling a!fromJson on that string does return a valid dictionary of data.&amp;nbsp; You should be able to refer to individual elements of the dictionary via standard dot notation in this case.&amp;nbsp; In this case if you stored the result of the fromJson call in local!jsonDictionary, then you could get &amp;quot;temp&amp;quot; just by calling &lt;em&gt;&lt;strong&gt;local!jsonDictionary.main.temp&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/18/pastedimage1590502427235v1.png" alt=" " /&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/74360?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 13:37:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:40234168-b4cb-4a5d-9d63-f454cac831cc</guid><dc:creator>gonzaloa</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is the json string as text:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;{&amp;quot;coord&amp;quot;:{&amp;quot;lon&amp;quot;:-3.7,&amp;quot;lat&amp;quot;:40.42},&amp;quot;weather&amp;quot;:[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],&amp;quot;base&amp;quot;:&amp;quot;stations&amp;quot;,&amp;quot;main&amp;quot;:{&amp;quot;temp&amp;quot;:297.85,&amp;quot;feels_like&amp;quot;:296.53,&amp;quot;temp_min&amp;quot;:296.15,&amp;quot;temp_max&amp;quot;:299.15,&amp;quot;pressure&amp;quot;:1026,&amp;quot;humidity&amp;quot;:44},&amp;quot;visibility&amp;quot;:10000,&amp;quot;wind&amp;quot;:{&amp;quot;speed&amp;quot;:2.6,&amp;quot;deg&amp;quot;:120},&amp;quot;clouds&amp;quot;:{&amp;quot;all&amp;quot;:20},&amp;quot;dt&amp;quot;:1590499496,&amp;quot;sys&amp;quot;:{&amp;quot;type&amp;quot;:1,&amp;quot;id&amp;quot;:6443,&amp;quot;country&amp;quot;:&amp;quot;ES&amp;quot;,&amp;quot;sunrise&amp;quot;:1590468593,&amp;quot;sunset&amp;quot;:1590521653},&amp;quot;timezone&amp;quot;:7200,&amp;quot;id&amp;quot;:3117735,&amp;quot;name&amp;quot;:&amp;quot;Madrid&amp;quot;,&amp;quot;cod&amp;quot;:200}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If I want to post in a read-only interface the &amp;quot;temp&amp;quot; and &amp;quot;pressure&amp;quot; value only for example, what expression/function should I use?&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to parse a JSON http response ?</title><link>https://community.appian.com/thread/74356?ContentTypeID=1</link><pubDate>Tue, 26 May 2020 12:56:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:acc950d4-988b-4ab2-a8fb-96e4b0ccc633</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;What specifically happens when you call a!fromJson on the above json string?&amp;nbsp; Any chance you can post it here as text instead of as a picture?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>