<?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>Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/discussions/f/integrations/8301/get-data-from-json-and-save-into-a-variable</link><description>Hi All, I was able to get the data from external System with a!httpQuery and using a!fromJson() I could able to get the data in the below format. [{&amp;quot;EMP_ID&amp;quot;:1,&amp;quot;EMP_NAME&amp;quot;:&amp;quot;ABC&amp;quot;,&amp;quot;ORG&amp;quot;:&amp;quot;VPC&amp;quot;,&amp;quot;MANAGER_CONTACT_NAME&amp;quot;:&amp;quot;My Name&amp;quot;}], So could someone help me how</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/83891?ContentTypeID=1</link><pubDate>Wed, 21 Jul 2021 06:16:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0775faf6-14d9-4169-9de6-1aba1698b59b</guid><dc:creator>Ram K</dc:creator><description>&lt;p&gt;Hi Harsh,&lt;br /&gt;If you are using in uesr interface&lt;br /&gt;then take&lt;br /&gt;local!data: a!fromjson(&lt;span&gt;[{"EMP_ID":1,"EMP_NAME":"ABC","ORG":"VPC","MANAGER_CONTACT_NAME":"My Name"}]&lt;/span&gt;),&lt;/p&gt;
&lt;p&gt;then for each field use&lt;br /&gt;local!empId = index(local!data,&amp;quot;&lt;span&gt;EMP_ID&lt;/span&gt;&amp;quot;,null)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if you need all values map to CDT then&lt;br /&gt;type!respective CDT (ex:Emp-Data)(&lt;/p&gt;
&lt;p&gt;empId:&lt;span&gt;index(local!data,&amp;quot;&lt;/span&gt;&lt;span&gt;EMP_ID&lt;/span&gt;&lt;span&gt;&amp;quot;,null),&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;empNmae:index(local!data,&amp;quot;EMP_NAME&amp;quot;,null)...etc&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/83883?ContentTypeID=1</link><pubDate>Tue, 20 Jul 2021 18:55:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:88ec3b6f-c666-4259-9546-92ab62a323a3</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;And a third time! What is your use case?!? Please, tell us what you want to achieve and for what purpose and we can help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/83882?ContentTypeID=1</link><pubDate>Tue, 20 Jul 2021 18:35:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dad46c61-9022-49b9-ae62-b71b24e938ae</guid><dc:creator>davel001150</dc:creator><description>&lt;p&gt;First, create interface, just leave blank for now.&lt;/p&gt;
&lt;p&gt;Make a!localVariables, make a local variable to save JSON data.&amp;nbsp; Use the fromJson() to convert a JSON document you downloaded into a dictionary.&lt;/p&gt;
&lt;p&gt;Now, create a text field, set it to read-only, set the value to the localVariable you made, local!jsonStorage or whatever you named it.&amp;nbsp; Now your interface should be displaying the whole dictionary that came from your JSON.&lt;/p&gt;
&lt;p&gt;Make a new text field, set it readOnly and set it&amp;#39;s value to index(local!jsonStorage, &amp;quot;fieldOne&amp;quot;, &amp;quot;&amp;quot;), now see output of that.&amp;nbsp; Since you&amp;#39;re starting out, it&amp;#39;s going to be little by little, but soon you should have all the fields displaying the data from the JSON exactly how you want.&lt;/p&gt;
&lt;p&gt;Then try to figure out how to get the users to edit them, then possibly cast that dictionary as a CDT.&amp;nbsp; Maybe even use toJSON() to output json depending on your&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/83871?ContentTypeID=1</link><pubDate>Tue, 20 Jul 2021 16:41:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:85489a25-627a-4d8f-8d22-d975ea9d1c19</guid><dc:creator>priyankadubey</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Based on my json script I want to create&amp;nbsp;input fields such as text, integer, dropdown in interface by passing json values.&lt;/p&gt;
&lt;p&gt;for eg. [{"filedname": "text"}, {"filedname": "integer"}] so it should create a text and an integer field based on whatever value I am passing in fieldname key&lt;/p&gt;
&lt;p&gt;How I can achieve that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/74422?ContentTypeID=1</link><pubDate>Thu, 28 May 2020 09:14:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:def9ed0f-92f2-4034-abde-4ed46a0f38da</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;I think you need to provide a bit more context about what you&amp;#39;re trying to achieve. You do not need to transform the JSON to a CDT unless you NEED that CDT for a specific purpose, and that&amp;#39;s the bit we&amp;#39;re missing from your description (e.g. if you want to store the data in a Database using Appian&amp;#39;s Write to Datastore capability then, yes, a CDT will be required). If you just want to throw the data onto a User Interface you could just transform the JSON into a Dictionary - using a!fromJson() - and work with that natively...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/74415?ContentTypeID=1</link><pubDate>Wed, 27 May 2020 19:00:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d65c0228-256d-415e-a821-e838e015b14b</guid><dc:creator>srikrishnak0002</dc:creator><description>&lt;p&gt;How to use a type constructor&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/69447?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 05:39:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:841bdd3f-0e99-4603-97ef-8fe2bab8ba4d</guid><dc:creator>sanjeetg891</dc:creator><description>&lt;p&gt;Hi harshav,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;were you able to convert your request to CDT ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/36322?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2016 18:40:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:448d7dda-6f3d-4dbe-8b53-2fee97d548d3</guid><dc:creator>ajaved</dc:creator><description>@harshav - If you are passing this to a process and the process has variables with same names set as parameters then you only need to do the following, this will extract and map.&lt;br /&gt;\tprocessParameters: a!fromJson(http!request.body)&lt;br /&gt;&lt;br /&gt;If you need to create a CDT from JSON then use cast function and whichever fields match will be populated.&lt;br /&gt;local!value: cast(    &lt;br /&gt;\t'type!{urn:com:appian:types:SAN}SAN_Process_Input',&lt;br /&gt;\ta!fromJson(http!request.body)&lt;br /&gt;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get Data From Json and Save Into a Variable</title><link>https://community.appian.com/thread/36319?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2016 17:29:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f837cdc9-86a9-4b62-abf2-c2b443bbe15a</guid><dc:creator>janakik</dc:creator><description>Make use of a!toJson() function and parse each element using a type constructor.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>