<?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>Converting a string to an integer array</title><link>https://community.appian.com/discussions/f/rules/8323/converting-a-string-to-an-integer-array</link><description>I have a form that captures user input to include multiple values via a checkbox field. The values are stored in a pv (integer array called pv!dataTypes_int). For example: (4;7;10), which are ids from another CDT used at a later point in the process to</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36445?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 16:40:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8879ae6d-32db-4134-b6f0-870e5d914542</guid><dc:creator>PhilB</dc:creator><description>Ok - that&amp;#39;s why you&amp;#39;ve seen the behaviour that you have. Putting 4;7;10 in a text rule input on the interface designer will not produce an array of three integers; it simply returns a string 6 characters long. I can see why you might expect this, though, as that&amp;#39;s similar to the /designer behaviour when adding multiple values to a constant of type list of text.&lt;br /&gt;&lt;br /&gt;If you try with a rule input that is text multiple and add each the values you mention above separately, the earlier examples that use tointeger() will work just fine as you&amp;#39;re then passing it a list of string rather than a single string.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36444?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 16:33:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:103d4d93-851c-4cfd-a5eb-c57c1e7216f3</guid><dc:creator>judym598</dc:creator><description>text - not text multiple&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36438?ContentTypeID=1</link><pubDate>Wed, 31 Aug 2016 13:33:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:77883c65-388f-4ea6-811b-0ecb24d9f113</guid><dc:creator>PhilB</dc:creator><description>Judy - out of interest, in your test was your rule input text, or text multiple?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36397?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:32:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f6cb5c3d-5023-4416-b13f-1aa5212bbcdc</guid><dc:creator>Colton Beck</dc:creator><description>Happy I could help!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36396?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:31:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6c69c759-2a1b-493a-90ce-cb2c6c52d03f</guid><dc:creator>judym598</dc:creator><description>Yes! That worked! Thank you!!!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36395?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:28:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5deb5b7d-c1c0-46a1-aa61-6d6046eb0838</guid><dc:creator>Colton Beck</dc:creator><description>Interesting.&lt;br /&gt;&lt;br /&gt;Would something like this work for you?:&lt;br /&gt;tointeger(split(&amp;quot;1;2;3&amp;quot;,&amp;quot;;&amp;quot;))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36394?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:26:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1f01b8d3-1d22-47ca-830d-57539dd76347</guid><dc:creator>gaurava322</dc:creator><description>Hi Judy, try touniformstring(), coltonb is correct..&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36393?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:23:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:552eb3b2-1092-4061-8e79-96be3e4851e9</guid><dc:creator>judym598</dc:creator><description>That works but it doesn&amp;#39;t work when I replace the {1,2,3,4} with my pv which is (4;7;10). Create a rule input (i.e., dataType of type &amp;#39;Text&amp;#39; and enter 4;7;10 as the test value) with the rule input =tointeger(touniformstring(ri!dataType)).  When tested - the result is 4710 not 4;7;10&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36392?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:16:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:926514a9-e275-4bc3-9e70-1502c713f14f</guid><dc:creator>Colton Beck</dc:creator><description>It may appear that way, but tostring() does not preserve inputs as multiple. &lt;br /&gt;&lt;br /&gt;To test, plug these into the expression editor to see the difference:&lt;br /&gt;tointeger(tostring({1,2,3,4}))&lt;br /&gt;tointeger(touniformstring({1,2,3,4}))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36391?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:05:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a5cc846-1611-4b77-b895-3ddfa4add5de</guid><dc:creator>judym598</dc:creator><description>The &amp;#39;tostring(pv!dataTypes_int)&amp;#39; part works just fine. The semicolons are saved there - my problem is when I convert it back to an integer.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a string to an integer array</title><link>https://community.appian.com/thread/36390?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 20:03:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fe7979dc-ac3e-4b08-9959-abd76e903626</guid><dc:creator>Colton Beck</dc:creator><description>Instead of using tostring() to convert to text, you could try touniformstring() which should maintain the array.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>