<?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>How to fetch string between two special characters?</title><link>https://community.appian.com/discussions/f/data/11654/how-to-fetch-string-between-two-special-characters</link><description>Hello, 
 
 I have a set of variables and values in a form of string. All I want is to fetch each n every Key/Value pair from the string as a separate variable value 
 
 for eg: Lets say my string is as below stored in &amp;quot;local!mixedString&amp;quot; variable 
 
</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/52624?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 06:02:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d11a618c-233e-41d1-88cf-01c410b5c60a</guid><dc:creator>smriti p0001</dc:creator><description>You can use split() function to achieve this&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51716?ContentTypeID=1</link><pubDate>Fri, 12 Jan 2018 21:13:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b635bf1e-5f64-4da9-8326-49cbf327b113</guid><dc:creator>jayakumars</dc:creator><description>This is a clean and elegant solution.  Thank you!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51358?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 15:48:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f3c4a1ea-f830-4cab-b886-5d99a7afab25</guid><dc:creator>PhilB</dc:creator><description>No problem!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51357?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 15:29:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87c3f76c-2217-4b2e-99a6-58afed119dce</guid><dc:creator>viveku3486</dc:creator><description>Got it, Thank you so much Phil for your time and effort. Really appreciate your help :)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51355?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 14:35:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af319b36-dfa2-4fde-9a44-9072f42334a7</guid><dc:creator>PhilB</dc:creator><description>The code works - just run it in an empty expression rule.&lt;br /&gt;
&lt;br /&gt;
The type!NameValue is just a way of containing the name value pairs that you have in your data, to access the names and values, use dot notation - for example .name or .value. Note that it&amp;#39;s a LIST of name value pairs as you have multiple name value pairs in your data.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51354?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 14:32:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:adb66b8c-f03b-49a2-869a-4b21eab0f1b2</guid><dc:creator>viveku3486</dc:creator><description>Hello Phil,&lt;br /&gt;
&lt;br /&gt;
Thanks for the response, I tried running your code and its giving me the error i.e &amp;quot; Recieved NameValue at index 1&amp;quot; . I understood the logic of your code but this &amp;quot;type!nameValue&amp;quot; concept is not cleared. Can you take a look once?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51351?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 12:52:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7757310c-a298-4533-a584-3413ac966393</guid><dc:creator>Dastagiri Dudekula</dc:creator><description>split() will help&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to fetch string between two special characters?</title><link>https://community.appian.com/thread/51349?ContentTypeID=1</link><pubDate>Thu, 04 Jan 2018 12:08:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0df0df2d-9d8c-4ac4-b945-41711bd9218b</guid><dc:creator>PhilB</dc:creator><description>&lt;p&gt;I&amp;#39;m pretty sure the below will do what you require, or at least will give you a starting point. It&amp;#39;s probably worth noting that your data really shouldnt be in the format you have, but I&amp;#39;m guessing you don&amp;#39;t have control over that.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;with(
  local!mixedString: &amp;quot;Name:Vivek|Work:Development|Tool:Appian&amp;quot;,
  a!forEach(
    items: split(
      local!mixedString,
      &amp;quot;|&amp;quot;
    ),
    expression: with(
      local!item: split(
        fv!item,
        &amp;quot;:&amp;quot;
      ),
      type!NameValue(
        name: local!item[1],
        value: local!item[2]
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>