<?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 handle &amp;quot;[key1:value1,key2:value2]&amp;quot;</title><link>https://community.appian.com/discussions/f/best-practices/38229/how-to-handle-key1-value1-key2-value2</link><description>I have got a input string like &amp;quot;[key1:value1,key2:value2]&amp;quot;, how to get the value by key?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to handle "[key1:value1,key2:value2]"</title><link>https://community.appian.com/thread/144153?ContentTypeID=1</link><pubDate>Wed, 08 Jan 2025 10:38:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d4252267-2fb8-46d8-a463-22e416eb6432</guid><dc:creator>deepandrapals2322</dc:creator><description>&lt;p&gt;If you can be sure that values won&amp;#39;t have special character &amp;quot;]&amp;quot;, you can use below code to get values.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/20/pastedimage1736332673637v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle "[key1:value1,key2:value2]"</title><link>https://community.appian.com/thread/143980?ContentTypeID=1</link><pubDate>Tue, 31 Dec 2024 18:12:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:180eda78-b579-49ac-a4e0-6e0ef04fccf1</guid><dc:creator>Kalpesh Gujrati</dc:creator><description>&lt;p&gt;&lt;a href="/members/liangl7510"&gt;liangl7510&lt;/a&gt;&amp;nbsp;, you can use the below code to convert you input string to a valid list of Map type variable and thn by using simple index function you can get the values based on the keys.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!input: substitute(
    substitute(
      &amp;quot;[key1:value1,key2:value2,key3:value3,key4:value4]&amp;quot;,
      &amp;quot;[&amp;quot;,
      &amp;quot;&amp;quot;
    ),
    &amp;quot;]&amp;quot;,
    &amp;quot;&amp;quot;
  ),
  local!arrayOfText: split(local!input, &amp;quot;,&amp;quot;),
  local!finalMap: a!flatten(
    a!forEach(
      items: local!arrayOfText,
      expression: a!localVariables(
        local!temp: split(fv!item, &amp;quot;:&amp;quot;),
        {
          a!map(key: local!temp[1], Value: local!temp[2])
        }
      )
    )
  ),
  index(
    local!finalMap.Value,
    wherecontains(&amp;quot;key1&amp;quot;, local!finalMap.key),
    &amp;quot;&amp;quot;
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle "[key1:value1,key2:value2]"</title><link>https://community.appian.com/thread/143922?ContentTypeID=1</link><pubDate>Fri, 27 Dec 2024 10:34:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9aabbef9-944b-49a6-ad6b-5eab6e7d4e27</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Where do you get this value from?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle "[key1:value1,key2:value2]"</title><link>https://community.appian.com/thread/143920?ContentTypeID=1</link><pubDate>Fri, 27 Dec 2024 09:08:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cbaa3e0a-2478-42c5-be8e-6b4e338246bf</guid><dc:creator>saimohancharugundla</dc:creator><description>&lt;p&gt;expecting this might be CDT value processed! Instead of working on the value, try working on it at its original CDT form.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to handle "[key1:value1,key2:value2]"</title><link>https://community.appian.com/thread/143919?ContentTypeID=1</link><pubDate>Fri, 27 Dec 2024 07:59:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2cb4c89b-cbc8-412c-8037-57d5fd1553d8</guid><dc:creator>Nandhini.Kumaran</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/liangl7510"&gt;liangl7510&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have developed a solution that achieve this dynamically. Below is the code for your reference.&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!input: &amp;quot;[key1:value1,key2:value2,key3:value3,key4:value4]&amp;quot;,&lt;br /&gt; local!stripText: mid(local!input, 2, len(local!input) - 2),&lt;br /&gt; local!tempString: split(split(local!stripText, &amp;quot;,&amp;quot;), &amp;quot;:&amp;quot;),&lt;br /&gt; local!dict: a!map(),&lt;br /&gt; local!updatedMaps: a!forEach(&lt;br /&gt; items: local!tempString,&lt;br /&gt; expression: if(&lt;br /&gt; mod(fv!index, 2) = 0,&lt;br /&gt; {},&lt;br /&gt; a!update(&lt;br /&gt; local!dict,&lt;br /&gt; fv!item,&lt;br /&gt; index(local!tempString, fv!index + 1, null())&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; local!keys: a!flatten(&lt;br /&gt; a!forEach(&lt;br /&gt; items: local!updatedMaps,&lt;br /&gt; expression: a!keys(fv!item)&lt;br /&gt; )&lt;br /&gt; ),&lt;br /&gt; a!update(&lt;br /&gt; a!map(),&lt;br /&gt; local!keys,&lt;br /&gt; a!forEach(&lt;br /&gt; items: local!updatedMaps,&lt;br /&gt; expression: index(fv!item, a!keys(fv!item), null)&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>