<?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>call web integration to write to datastore</title><link>https://community.appian.com/discussions/f/data/22410/call-web-integration-to-write-to-datastore</link><description>HI, 
 I am trying to create a process with 2 nodes: call an integration + write to db 
 The integration returns a Result.body - this variable is available in the next node....Example of body (json) 
 
 body ( Dictionary) 
 
 
 orders ( List of Dictionary</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: call web integration to write to datastore</title><link>https://community.appian.com/thread/87754?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 15:32:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:944b3f53-c7df-4dff-9927-6da1c7ae5dc5</guid><dc:creator>octavian</dc:creator><description>&lt;p&gt;Yes - the integration was setup like that &amp;quot;Convert JSON to Appian Value&amp;quot; - but was not working,&lt;/p&gt;
&lt;p&gt;However, when I edited from within the node properties it took effect and now I can iterate and save into process variable&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: call web integration to write to datastore</title><link>https://community.appian.com/thread/87752?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 15:09:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1b9187ce-c83f-4697-a85b-cf14913ac5e9</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Is it possible that the result from the integration is returning all the JSON as text? There&amp;#39;s an option in your integration that converts the JSON response to a dictionary, but if you don&amp;#39;t choose that it will return the body as one big text string (and you can&amp;#39;t index into that text string).&lt;/p&gt;
&lt;p&gt;Assuming that you&amp;nbsp;&lt;em&gt;do&lt;/em&gt; choose that option, you certainly should be able to save the orders as a process variable of type &amp;quot;Orders&amp;quot;. Can you show your full output from the integration? Then we can see if the index works for the given response.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: call web integration to write to datastore</title><link>https://community.appian.com/thread/87750?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 14:48:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bb083d68-c0f2-4162-bc93-b57e5d604de0</guid><dc:creator>octavian</dc:creator><description>&lt;p&gt;Ok,&lt;/p&gt;
&lt;p&gt;So I debuged more and write to db node appears to work with a plain row definition like this:&lt;/p&gt;
&lt;p&gt;={ {&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;entity: cons!RS_TestConst,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;data: {id: NULL,name: &amp;quot;today_entry&amp;quot; , numb: 100}&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then I focused on the &amp;quot;call integration&amp;quot; node to save into a process variable - see screenshots.&lt;/p&gt;
&lt;p&gt;I made a process variable of type &amp;quot;orders&amp;quot; - this is a data type with all the fields. then tried to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;save body.orders[1] into it --- process variable single value, &lt;br /&gt;and also process variable multiple values (that is what you see in the screenshot&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But in general if my integration is working and returns a bunch of &amp;quot;rows&amp;quot; in JSON format - what is the &amp;quot;best&amp;quot; approach to save those into a table?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/1832.error.png" /&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/setup_5F00_integration.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: call web integration to write to datastore</title><link>https://community.appian.com/thread/87749?ContentTypeID=1</link><pubDate>Mon, 08 Nov 2021 13:59:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:35ad92dc-693c-4fe9-8678-1c8aa92235c8</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Ok can you post a screenshot of the write to data store entity node? Also can you post the full error message you&amp;#39;re receiving?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: call web integration to write to datastore</title><link>https://community.appian.com/thread/87722?ContentTypeID=1</link><pubDate>Fri, 05 Nov 2021 23:18:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f6967a60-24ec-42bc-aba8-a43aeec7d9f6</guid><dc:creator>octavian</dc:creator><description>&lt;p&gt;yes, actually I used 2&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: call web integration to write to datastore</title><link>https://community.appian.com/thread/87718?ContentTypeID=1</link><pubDate>Fri, 05 Nov 2021 21:25:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:929d33b5-c75d-4a7e-83ac-ddd0c17181c6</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;One thing to confirm - did you actually use 0 as the index or were you just giving an example? Because Appian uses 1 indexing, so you should always start with 1 to get the first item.&amp;nbsp;If that&amp;#39;s not your issue, could you post a screenshot of your write to data store entity node?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>