<?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>write data back to Database from Interface</title><link>https://community.appian.com/discussions/f/user-interface/19187/write-data-back-to-database-from-interface</link><description>Hi All, 
 am new to Appian, i have developed the Interface to fetch master values from Database, show it in a grid for adding or updating the data, please help me how can write the updated or added data back to Database, 
 Sorry, the Insert Code link</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75721?ContentTypeID=1</link><pubDate>Fri, 31 Jul 2020 05:45:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2ad572dc-f990-467a-a4de-4b404ac4aa8f</guid><dc:creator>sergal</dc:creator><description>&lt;p&gt;&lt;strong&gt;Hi Stewart&lt;/strong&gt;, I believe I am experiencing the same problem, see error message:&lt;em&gt; &amp;quot;An error occurred while trying to write to the entity &amp;ldquo;vehicle&amp;rdquo; [id=62d4f82a-d537-42fc-8e4e-c9d39f791ae1@4643, type=SG_VM_Vehicle (id=3470)] (data store: SG VM MySQL Data Store). Details: org.hibernate.exception.GenericJDBCException: could not insert: [SGVMVehicleDT2869]: java.sql.SQLException: Field &amp;#39;vehicleid&amp;#39; doesn&amp;#39;t have a default value Data: TypedValue[it=3470,v={&amp;lt;null&amp;gt;,White,White,3435643,1990,1,White,Sedan,5676545,2020-08-30,&amp;lt;null&amp;gt;,KPMG_SG,2020-07-31 05:24:28.1,,,&amp;lt;null&amp;gt;}]&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;But the vehicle was set up as primary key, integer, and i did check the box for the automated generation....what to do?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75268?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2020 13:31:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:89c7d360-5e3e-4438-ab2e-879a19102a11</guid><dc:creator>vineethk0001</dc:creator><description>&lt;p&gt;Thanks all, it worked&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75202?ContentTypeID=1</link><pubDate>Mon, 06 Jul 2020 10:13:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:06e6814d-13d8-4f94-89e7-11b662497023</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Vineeth - this is telling&amp;nbsp;you that the row(s) you;re trying to insert into the Database table don&amp;#39;t have any values for the Primary Keys. Typically we designate an Integer column in the database as the Primary&amp;nbsp;Key and get the database to automatically generate that key for us so we don&amp;#39;t have to worry about&amp;nbsp;it in Appian.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you choose to not do this&amp;nbsp;you &lt;em&gt;must&amp;nbsp;&lt;/em&gt;&lt;/span&gt;provide a value when sending the data from Appian to the DB.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75193?ContentTypeID=1</link><pubDate>Sat, 04 Jul 2020 20:07:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:75d3171f-f85e-4ad2-b3d4-3f69fc36adb6</guid><dc:creator>komalj0001</dc:creator><description>&lt;p&gt;Please try by sending the Id as well along with CDT &amp;quot;&lt;span&gt;LMP_REF_REGION&lt;/span&gt;&amp;quot; like &amp;quot;&lt;span&gt;{5106,1,REGN01,APA,1,&amp;lt;null&amp;gt;,,&amp;lt;null&amp;gt;,}&lt;/span&gt;&amp;quot;or make it as auto-generated&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75192?ContentTypeID=1</link><pubDate>Sat, 04 Jul 2020 18:39:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5d64ea28-50a8-4f6a-83b5-e37cf12527f0</guid><dc:creator>vineethk0001</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;i configured the Process Flow with all the details with Write to Datastore activity, but i get the below error, what am i missing&lt;/p&gt;
&lt;p&gt;An error occurred while trying to write to the entity &amp;ldquo;LMP_REF_REGION&amp;rdquo; [id=678cceda-7c25-475b-b4fd-29be176e50e2@20938, type=LMP_REF_REGION (id=5106)] (data store: LMP Nomination Process Data Store). Details: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): LMPREFREGIONDT4986 Data: TypedValue[it=5106,v={&amp;lt;null&amp;gt;,1,REGN01,APA,1,&amp;lt;null&amp;gt;,,&amp;lt;null&amp;gt;,}]&lt;/p&gt;
&lt;p&gt;Warm Regards&lt;/p&gt;
&lt;p&gt;Vineeth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75178?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2020 08:10:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:15431dce-dff5-40b0-8673-5765e04981b2</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Not every interface is displayed in the context of a running process model (e.g. Record Views), where there may be patterns when updating the database directly from the User Interface will be legitimate. Typically (although there will always be exceptions) you would only make simple updates via this pattern. Anything that is complex can easily lead you to ending up trying to replicate all of the features found in a process model! So beware!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75177?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2020 07:33:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3bd51cea-6cde-43f6-b6cf-6f75e9620402</guid><dc:creator>ManuelHTG</dc:creator><description>&lt;p&gt;Typically you won&amp;#39;t write to the DB directly from an interface, but rather save the data when you click on submit.&lt;/p&gt;
&lt;p&gt;If that already covers your case, I would suggest to have your interface as a form in a process model and then save the data with the smart service.&lt;/p&gt;
&lt;p&gt;You have plenty of examples as well on the academy.&lt;/p&gt;
&lt;p&gt;Additionally, it is not recommended to use constants like this:&lt;/p&gt;
&lt;p&gt;LMP_BUTTON_VALUES[5],&lt;/p&gt;
&lt;p&gt;I would rather save the value you have on the fifth item to a new constant, so the code is easier to read.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75135?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 10:04:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07be9f42-648c-4295-a3f4-35c26d1eac09</guid><dc:creator>bluepn</dc:creator><description>&lt;p&gt;There are already sample codes under the link.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt; a!writeToDataStoreEntity(
                  dataStoreEntity: cons!EMPLOYEE_DSE,
                  valueToStore: local!dataToLoad
                )&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You could try it out first and let us know if you have encountered any error messages.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75134?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 10:01:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:236c6ec0-8ae0-4420-b41d-6eb76b8f6584</guid><dc:creator>vineethk0001</dc:creator><description>&lt;p&gt;Hi Bluepn, we are using 19.4, any code sample please&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: write data back to Database from Interface</title><link>https://community.appian.com/thread/75128?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2020 09:27:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:819f77d0-420f-4b5a-8713-713daa94468e</guid><dc:creator>bluepn</dc:creator><description>&lt;p&gt;What is the version of Appian you are developing on?&lt;/p&gt;
&lt;p&gt;You could make use of the function &lt;span&gt;a!writeToDataStoreEntity() if you want to write the data back to datastore directly from the interface, as below:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/17.4/recipe_use_the_write_to_data_store_entity_smart_service_function_on_an_interface.html"&gt;https://docs.appian.com/suite/help/17.4/recipe_use_the_write_to_data_store_entity_smart_service_function_on_an_interface.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;or use the rule inputs (ri!) you created in the interface and pass the variable back to process model, then use the write to database entity smart service to achieve this.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/19.4/Write_to_Data_Store_Entity_Smart_Service.html"&gt;https://docs.appian.com/suite/help/19.4/Write_to_Data_Store_Entity_Smart_Service.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>