<?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>castinvalid</title><link>https://community.appian.com/discussions/f/new-to-appian/24497/castinvalid</link><description>Hi, 
 am querying data and storing the value in local variable and am using it to save to nexasignee value 
 
 when i include cast it will give error 
 
 when i don&amp;#39;t include cast here it will give castinvalid error how can i fix it 
 what am doing here</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: castinvalid</title><link>https://community.appian.com/thread/94614?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 17:31:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1547ab6b-c889-41a9-91d9-fa58e85cbd5b</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;If the value of your queried local variable is of the type &amp;quot;list of dictionary&amp;quot;, you&amp;#39;ll probably want to change it (preferably at the local variable definition itself) to be single type.&amp;nbsp; The easiest way to do this (presuming you&amp;#39;re setting it up in such a way that you&amp;#39;re always guaranteed to get a [single] result from your query) is to add &amp;quot;[1]&amp;quot; after the &amp;quot;.data&amp;quot; part at your query result - perhaps even inside the expression rule, if it&amp;#39;s designed to query a single result anywhere it&amp;#39;s used.&lt;/p&gt;
&lt;p&gt;The difference here is that &amp;quot;updateDictionary&amp;quot; is a little picky about data types, as you&amp;#39;ve found.&amp;nbsp; Less actually about the &lt;em&gt;type&lt;/em&gt; than whether it&amp;#39;s an array or not.&amp;nbsp; I don&amp;#39;t think you should need to use &amp;quot;cast()&amp;quot; here, though, as long as the data you&amp;#39;re feeding in initially is correct.&lt;/p&gt;
&lt;p&gt;Also, make sure your &amp;quot;get approver role&amp;quot; rule is returning non-list data.&amp;nbsp; Though in this case maybe just wrapping the rule call in &amp;quot;toString()&amp;quot; would be sufficient - if it&amp;#39;s returning a list, that could also be messing up your updateDictionary functionality.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: castinvalid</title><link>https://community.appian.com/thread/94612?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 17:15:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9392a1ae-0c21-45be-8ca2-aedac9deb46e</guid><dc:creator>Naresh</dc:creator><description>&lt;p&gt;I am not quit understand your question. But this is what I am expecting, you are trying to save &lt;span&gt;List of Variant or DataSubset data to your text filed.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you update your code with this logic where ever you have&amp;nbsp;local!crModulesStatusHistoryfirLastCC_cdt.addedBy_txt&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="xml"&gt;
tostring(index(local!crModulesStatusHistoryfirLastCC_cdt, &amp;quot;addedBy_txt&amp;quot;, &amp;quot;&amp;quot;))

incase if the above logic won&amp;#39;t work try this one as well

tostring(index(local!crModulesStatusHistoryfirLastCC_cdt.data, &amp;quot;addedBy_txt&amp;quot;, &amp;quot;&amp;quot;))&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you still see an issue please provide us what error message that you are getting&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>