<?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>Prevent refresh on local variable based on queryentity()</title><link>https://community.appian.com/discussions/f/user-interface/23616/prevent-refresh-on-local-variable-based-on-queryentity</link><description>Hi All, 
 I have a local variable defined within load() which retrieves data from one of the table using a!queryentity() . 
 local!data: rule!getAllData(id) 
 Whenever there is an insert or update happens in the table , local!data pulls the new values</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Prevent refresh on local variable based on queryentity()</title><link>https://community.appian.com/thread/90764?ContentTypeID=1</link><pubDate>Mon, 07 Feb 2022 14:47:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:606b772c-b4e9-423e-9fdc-6391b498c0f5</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;You have two options for this design pattern:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create multiple task forms and activity chain them together. To do this correctly, you will need to pass the results from your first form to the second form. See &lt;a href="https://docs.appian.com/suite/help/latest/Process_Model_Recipes.html#using-activity-chaining-to-display-multiple-forms-in-succession"&gt;this example&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a SAIL wizard. This would use a single form that dynamically changes by displaying different sections based on a button click. See &lt;a href="https://docs.appian.com/suite/help/latest/recipe-build-a-wizard-with-milestone-navigation.html"&gt;this example&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;In either case, it shouldn&amp;#39;t be necessary to query twice because you should be using the results of your first query throughout your process or form.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prevent refresh on local variable based on queryentity()</title><link>https://community.appian.com/thread/90744?ContentTypeID=1</link><pubDate>Mon, 07 Feb 2022 08:45:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:03e819a8-4bb5-4801-a73b-c3a423d6c951</guid><dc:creator>Ash</dc:creator><description>&lt;p&gt;Hi Mike - Thankyou for your suggestion . While i am trying to make these changes&amp;nbsp; , i have one query -&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have a form with editable grid which helps user to create or update questions(question id is primary key here), user can add or update new questions and click on &amp;quot;Next&amp;quot; button which again displays a form where user can enter question Options/details for those questions which is created on first page.&lt;/p&gt;
&lt;p&gt;Question(Parent table) - PK- questionId&lt;/p&gt;
&lt;p&gt;Question Option(Child table) - FK - questionId&lt;/p&gt;
&lt;p&gt;Based on current design when user click on &amp;quot;Next&amp;quot; button , we are using writeToDataStoreEntity and writes questionId into DB and then in the next page we make DB call and create Question Option for those questionIds.&lt;/p&gt;
&lt;p&gt;Now i want to change the design and make sure that whenever user click on &amp;quot;Submit&amp;quot; button (which is on the second&amp;nbsp;form) then only&amp;nbsp;i want to write the details into DB . With this approach i wont be having questionId when i go to the next page so my idea is to generate unique question ids in the SAIL form when user click on Next button and make sure those uniquely generated id&amp;#39;s are not present in DB currently .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;How this can be done from SAIL ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prevent refresh on local variable based on queryentity()</title><link>https://community.appian.com/thread/90636?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 15:39:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b74edff2-92d4-45ea-b73a-822c944995da</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="58142" url="~/discussions/f/user-interface/23616/prevent-refresh-on-local-variable-based-on-queryentity/90575#90575"]Also, why m&amp;nbsp;I using load() is because these applications have been developed way long back [/quote]
&lt;p&gt;That makes sense - just checking.&amp;nbsp; I suggest you prioritize changing this over to a!localVariables as soon as you can, though.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="58142" url="~/discussions/f/user-interface/23616/prevent-refresh-on-local-variable-based-on-queryentity/90575#90575"]what should be my approach to handle all the active tasks or instances in PROD [/quote]
&lt;p&gt;That highly depends on what you hope to happen with active instances.&amp;nbsp; You won&amp;#39;t be (easily) able to amend active instances to query the data prior to the task, so any changes you make should ensure that active tasks can continue working at least as they currently do.&amp;nbsp; New instances can get your new desired behavior.&amp;nbsp; This could be accomplished by editing the interface to check whether a value was passed in from the process, and if so, the interface uses that value, and if not, then it does the query as it does currently.&amp;nbsp; This would allow you to safely add the functionality to pass the data in from the process but have existing instances of the task continue to work as-is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prevent refresh on local variable based on queryentity()</title><link>https://community.appian.com/thread/90575?ContentTypeID=1</link><pubDate>Thu, 03 Feb 2022 05:59:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d3a6833-0dde-4870-89fb-710f8562fb41</guid><dc:creator>Ash</dc:creator><description>&lt;p&gt;Hi Mike - Thankyou for your response .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If its the only way then&amp;nbsp;what should be my approach to handle all the active tasks or instances in PROD ?&amp;nbsp; I can only think of closing all the tasks before this change goes to production . Is there any alternative ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, why m&amp;nbsp;I using load() is because these applications have been developed way long back and I agree its not fully updated with latest features &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt; definitely we have to do this in future .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Prevent refresh on local variable based on queryentity()</title><link>https://community.appian.com/thread/90571?ContentTypeID=1</link><pubDate>Wed, 02 Feb 2022 18:16:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a686c12c-ee10-40e1-8a63-0f704c709220</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="58142" url="~/discussions/f/user-interface/23616/prevent-refresh-on-local-variable-based-on-queryentity"]i dont want to query the table again even though&amp;nbsp;i refresh the page from the browser .[/quote]
&lt;p&gt;The only way to do this is to query the data in the process prior to the task and pass the queried data into the task as a rule input - fairly easy to do.&lt;/p&gt;
&lt;p&gt;Also: why are you using &lt;em&gt;load()&lt;/em&gt;?&amp;nbsp; Are you really on a 3+ year old Appian installation?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>