<?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>Variable is not refreshing</title><link>https://community.appian.com/discussions/f/user-interface/22133/variable-is-not-refreshing</link><description>Good afternoon all. 
 Here is what&amp;#39;s going on. 
 I am given a string, or Text variable. This variable is used to store employee IDs. Although it is one variable, it can contain several IDs (or contain none). There is nothing I can do about this and I</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86693?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:30:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:00cdea41-6186-41f3-abee-30a0bd06b3c6</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;A secondary suggestion would be, if you&amp;#39;re forced to stick with a Text-As-Array setup (under the assumption that the implementation of the array is under your control), would be to use JSON to take the guesswork out of formatting.&amp;nbsp; That is to say, convert the array of IDs to a JSON string before storing it in the text variable, using a!toJSON(), and use a!fromJSON() to convert it back later when needed.&amp;nbsp; In this way you&amp;#39;re not stuck implementing your own parsing routine for the array-turned-string.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86692?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:27:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0b2ec34b-e116-4e25-a905-3d3dea914b38</guid><dc:creator>khabran</dc:creator><description>&lt;p&gt;Thanks Mike.&lt;/p&gt;
&lt;p&gt;So the &amp;quot;record&amp;quot; is a CDT containing the employeeIDs (which is type Text and not an array). There was no space being added after the semicolon, it was just doing that itself. Upon, removing that space, it is now updating the Employee Names array correctly. I agree with the issues that could arise in the future with these variables and this logic. Unfortunately, there is nothing at this time I can do about it. It was what I was given and I have to make due. I think it would be better to have the Text variable as an array and eliminate the need to split() the variable to access each of the employee IDs.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86691?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:20:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:18d232ea-5a3d-4fcf-b0d2-484af0998048</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I was going to suggest it would be sufficient to do &amp;quot;split(ri!record.employeeIDs, &amp;quot;; &amp;quot;), i.e. adding a space after the semicolon in your original code.&lt;/p&gt;
&lt;p&gt;Do you have any way of knowing why the employee IDs are coming through in ri!record in this manner?&amp;nbsp; The part that makes me nervous about this is that even a slight future adjustment to how the variable is formed, would throw off your logic.&lt;/p&gt;
&lt;p&gt;Out of curiosity, can you confirm that &amp;quot;ri!record&amp;quot; is single, and that employeeIDs is also single, and that the employeeID string is being intentionally concatenated together and semicolon-separated?&amp;nbsp; Because if, for example, ri!record is actually an array, then a different approach would be needed here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86689?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:15:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf426466-4b06-4e02-a378-d65cdca22b71</guid><dc:creator>khabran</dc:creator><description>&lt;p&gt;Never mind. I&amp;#39;m using the stripwith() rule.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86687?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:10:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cc9d8e0e-6ad8-4df9-a683-8ba06c72152c</guid><dc:creator>khabran</dc:creator><description>&lt;p&gt;Ok, thank you! The space after the semicolon was the issue. I&amp;#39;m not sure how to remove that space before processing the Text variable. Any help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86686?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:09:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c2e7c268-a766-40ce-ab38-d334a6592100</guid><dc:creator>khabran</dc:creator><description>&lt;ul&gt;
&lt;li&gt;ri!record.employeeIDs is type Text.&lt;/li&gt;
&lt;li&gt;There is a space after each semicolon.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86685?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 17:04:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:079f9e9f-edc7-4a30-8514-9ed240aaea26</guid><dc:creator>khabran</dc:creator><description>&lt;p&gt;Thanks for responding, Mike.&lt;/p&gt;
&lt;p&gt;I agree with the redundancy, but it wasn&amp;#39;t working without the refreshvariable, so I thought I would throw that in there.&lt;/p&gt;
&lt;p&gt;The multiple values in the Text variable are as follows: &amp;quot;1; 2&amp;quot;. I hope this helps. It looks as if the last value is not followed by a semicolon. Does this make any difference?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Variable is not refreshing</title><link>https://community.appian.com/thread/86682?ContentTypeID=1</link><pubDate>Wed, 06 Oct 2021 16:24:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:82ca763b-f61b-4924-b539-3dca5f403626</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;I don&amp;#39;t see anything particularly wrong with the posted code snippet (beyond certain code style nitpicks).&amp;nbsp; One important thing to note is that your &amp;quot;refreshOnVarChange&amp;quot; is unnecessary as it&amp;#39;s redundant; all &lt;em&gt;a!localVariables()&lt;/em&gt; variables automatically have &amp;quot;refreshOnReferencedVarChange&amp;quot; set to TRUE by default unless overridden, so your local!employees variable would already refresh on any update to local!employeeIDs.&amp;nbsp; The same would be true for local!employeeIDs upon update to ri!record.employeeIDs.&lt;/p&gt;
&lt;p&gt;Just to double check, what data type is ri!record.employeeIDs?&amp;nbsp; Are we assuming it&amp;#39;s a single string of semicolon-separated ID values with no additional spaces in between?&amp;nbsp; I&amp;#39;m just checking because a common point of confusion around here arises from accidentally assuming Appian&amp;#39;s default method of displaying an array of data in text (separated by semicolons) is equivalent to a semicolon-separated text list, even though these two things aren&amp;#39;t direclty equivalent without some type-casting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>