<?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>User input task</title><link>https://community.appian.com/discussions/f/process/20299/user-input-task</link><description>Hello, 
 In the &amp;quot;user input task&amp;quot; there is an option &amp;quot; Allow users to save a draft of in-progress tasks&amp;quot;. 
 I&amp;#39;d like to know if there was a way to launch the save draft by the system, I mean if we can do the save without an user&amp;#39;s action (click on the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: User input task</title><link>https://community.appian.com/thread/79236?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 07:43:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:84464b05-5a95-4aad-9813-610f9bbbea0c</guid><dc:creator>maximeg0001</dc:creator><description>&lt;p&gt;Hell,&lt;/p&gt;
&lt;p&gt;I will see if the&amp;nbsp;&lt;span&gt;a!writeToDataStoreEntity() on each field can be&amp;nbsp;implemented.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The &amp;quot;auto save&amp;quot; solution is&amp;nbsp;&lt;/span&gt;&lt;span lang="en"&gt;to avoid the 1 hour timeout because some users need lot of time to fill the form and when they refresh the application they lost everything.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Very thank you all for your answers.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User input task</title><link>https://community.appian.com/thread/79225?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 20:58:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9054a50c-6127-43e7-bbc5-e9007ab34f08</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Also agree there is nothing natively OOTB that will allow auto-saving of forms.&amp;nbsp; However, as the a!writeToDataStoreEntity() function could be called from any field&amp;#39;s saveInto parameter, if this were my requirement I would create&amp;nbsp;a rule that takes the CDT input and writes to the DB using this function, as the others have suggested - plugged into each field&amp;#39;s saveInto.&amp;nbsp; Along these lines, if nothing has changed on the form, what is the use case requiring auto-saving of unchanged data?&lt;/p&gt;
&lt;p&gt;Purely food for thought, we can call fn!executeStoredProcedure() within a refreshVariable.&amp;nbsp; Note this function is not &lt;em&gt;designed&lt;/em&gt; to call procedures which alter and data within the DB - however it does allow this in some situations.&amp;nbsp; I cannot speak to if this will change in the future.&amp;nbsp; However, I have 2 cases in production where data is inserted or updated using this, such as a proxy function which runs on task assignment and updates a logging table if a proxy assignment is made, and a round robin task assignment procedure that maintains the task assignment history and pulls the next assignee.&lt;/p&gt;
&lt;p&gt;In the example below, we are not writing to the DB, but a procedure is called which adds 10 to the local!input value and returns the output.&amp;nbsp; This procedure is fired on each local!input field change, OR after each 30 seconds (based on local!save being refreshed), without any changes to the field saveInto&amp;#39;s.&amp;nbsp; With some modifications it may be possible to load data into the DB with this method.&lt;/p&gt;
&lt;p&gt;Some other use cases that may benefit from fn!executeStoredProcedure() within a local variable load could be for logging any interface views, etc.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;=a!localVariables(
  local!input: 10,
  local!save: a!refreshVariable(
    value: now(),
    refreshInterval: 0.5
  ),
  local!output: a!refreshVariable(
    value: fn!executestoredprocedure(
      dataSourceName: &amp;quot;java:comp/env/jdbc/sql_lookup&amp;quot;,
      proceedureName: &amp;quot;usp_testAdd10&amp;quot;,
      inputs: {
        {name: &amp;quot;NUM&amp;quot;, value: local!input}
      }
    ),
    refreshOnVarChange: local!save
  ),
  {
    a!textField(
      label: &amp;quot;Input&amp;quot;,
      labelPosition: &amp;quot;ADJACENT&amp;quot;,
      value: local!input,
      saveInto:  local!input,
    ),
    a!textField(
      label: &amp;quot;Output&amp;quot;,
      labelPosition: &amp;quot;ADJACENT&amp;quot;,
      value: local!output.parameters.RESULT,
      readOnly: true
    ),
    a!textField(
      label: &amp;quot;Last Save&amp;quot;,
      labelPosition: &amp;quot;ADJACENT&amp;quot;,
      value: local!save,
      readOnly: true
    )
  }
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Procedure:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[usp_testAdd10] 
	@NUM varchar(15),
	@RESULT varchar(16) OUTPUT
AS
BEGIN
	SET @RESULT = cast((cast(@NUM as int) + 10) as varchar(16))

	RETURN
END


GO&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User input task</title><link>https://community.appian.com/thread/79215?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 18:53:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:07a15d29-8d98-4a02-b75e-ff783f290a9d</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Agreed, if the requirement is strong enough and a high level of effort is acceptable, you could perhaps set up a custom table just to hold temporary on-form values pertaining to a specific user (indexed to their Appian username for example), wherein you store a JSON-ized text string representing a CDT containing all data editable on that form (or if it&amp;#39;s a massive amount, maybe individual fields instead).&amp;nbsp; Then any time the user changes anything, the form could wrap that value back into the JSON string and instantly beam it back over to that table... and when a user loads the form in the first place, the table would be queried and checked to see if it already contains any value.&lt;/p&gt;
&lt;p&gt;It should be underlined that this has nothing to do with the functionality found in the &amp;quot;save a draft&amp;quot; button provided by Appian - in fact I would suggest anyone going this route actually disable that button so as to not confuse matters more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User input task</title><link>https://community.appian.com/thread/79214?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 18:49:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:232be2f4-5bad-462b-a18d-67dfc19e0d1c</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;Agree with Mike - I don&amp;#39;t think this is possible. The only thing that might work (but would likely require a lot of effort) is if you wrote to a database table using a!writeToDataStoreEntity() on the task any time any field is updated. Then, whenever you load the form, you would pull the data from the database and the user would never have to save it.&lt;/p&gt;
&lt;p&gt;I should clarify - I have never actually done this, so there might be some weird edge cases or it might just be too much effort to be feasible. Theoretically it should work though!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: User input task</title><link>https://community.appian.com/thread/79189?ContentTypeID=1</link><pubDate>Wed, 27 Jan 2021 17:36:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ea5bd432-0c45-42a4-b022-46e8bacf61ec</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I don&amp;#39;t know of any current way to do this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>