<?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>Local variable based on queryEntity not refreshing</title><link>https://community.appian.com/discussions/f/general/20415/local-variable-based-on-queryentity-not-refreshing</link><description>Hi, 
 I have a CDT based on a view I built on the Appian MariaDB database. An expression rule (say, rule!GetAllData) pulls from the corresponding DSE through a simple queryEntity, retrieving all results. In an interface, I have a local variable defined</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Local variable based on queryEntity not refreshing</title><link>https://community.appian.com/thread/79732?ContentTypeID=1</link><pubDate>Mon, 22 Feb 2021 11:20:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:741049a1-e347-433f-ad65-bd4fcd168f5a</guid><dc:creator>scristalli</dc:creator><description>&lt;p&gt;Thank you for the suggestion of looking into the expression rule.&lt;br /&gt;I was treating it as a &amp;quot;black box&amp;quot; performing the query, but I overlooked the fact that it wasn&amp;#39;t a plain wrapper of the queryEntity: it used local variables inside to cast the results of the queryEntity to a CDT.&lt;br /&gt;I had even a wrong mental model on how these local variables would behave when including the expression rule inside an interface (I believed the entire expression rule would be always re-evaluated &amp;quot;from scratch&amp;quot;, as a &amp;quot;function&amp;quot;, when in reality the SAIL of the expression rule simply gets substituted in the SAIL of the interface).&lt;br /&gt;In the end, I set the correct refresh attributes in the local variables inside the expression rule, and now everything is fine.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Local variable based on queryEntity not refreshing</title><link>https://community.appian.com/thread/79592?ContentTypeID=1</link><pubDate>Tue, 16 Feb 2021 18:00:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:aff1194a-e6b1-4899-8a54-4bfa02c5a890</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;My first guess here would be that you need to make sure the local variable is properly set up to refresh.&amp;nbsp; Can you share any further detail about how &amp;quot;rule!GetAllData()&amp;quot; is set up?&amp;nbsp; Also, have you thought about setting up local!data in such a way that it refreshes on button click without having to manually save a new query result back into it?&amp;nbsp; Such as by using the &amp;quot;refreshOnVarChange&amp;quot; parameter in &lt;em&gt;a!refreshVariable()&lt;/em&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>