<?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 split a map based on user input value</title><link>https://community.appian.com/discussions/f/new-to-appian/38616/how-to-split-a-map-based-on-user-input-value</link><description>hi, 
 I am trying to split a map based on user input 
 local!data: { a!map(id: 1, name: &amp;quot;Alice&amp;quot;, age: 10, city: &amp;quot;New York&amp;quot;,school:&amp;quot;NewYork&amp;quot;), a!map(id: 2, name: &amp;quot;Bob&amp;quot;, age: 12, city: &amp;quot;Los Angeles&amp;quot;,school:&amp;quot;NewYork&amp;quot;), a!map(id: 3, name: &amp;quot;Charlie&amp;quot;, age:</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to split a map based on user input value</title><link>https://community.appian.com/thread/145838?ContentTypeID=1</link><pubDate>Sat, 01 Mar 2025 15:14:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ef3b4e01-242b-462d-8fe9-fc2a79ed1d00</guid><dc:creator>venkatrea696188</dc:creator><description>&lt;p&gt;I am not sure what you are trying to achieve but here is the sample code that matches your requirement&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!data: {
    a!map(
      id: 1,
      name: &amp;quot;Alice&amp;quot;,
      age: 10,
      city: &amp;quot;New York&amp;quot;,
      school: &amp;quot;NewYork&amp;quot;
    ),
    a!map(
      id: 2,
      name: &amp;quot;Bob&amp;quot;,
      age: 12,
      city: &amp;quot;Los Angeles&amp;quot;,
      school: &amp;quot;NewYork&amp;quot;
    ),
    a!map(
      id: 3,
      name: &amp;quot;Charlie&amp;quot;,
      age: 13,
      city: &amp;quot;Chicago&amp;quot;,
      school: &amp;quot;NewYork&amp;quot;
    ),
    a!map(
      id: 4,
      name: &amp;quot;David&amp;quot;,
      age: 14,
      city: &amp;quot;Houston&amp;quot;,
      school: &amp;quot;NewYork&amp;quot;
    )
  },
  local!keys: a!keys(local!data[1]),
  local!inputindex: if(
    a!isNullOrEmpty(ri!input),
    &amp;quot;&amp;quot;,
    if(
      contains(local!keys, ri!input),
      wherecontains(touniformstring(ri!input), local!keys),
      null
    )
  ),
  local!keys2: if(
    a!isNullOrEmpty(local!inputindex),
    null,
    rdrop(
      local!keys,
      (length(local!keys) - local!inputindex)
    )
  ),
  local!keys3: if(
    a!isNullOrEmpty(local!inputindex),
    null,
    ldrop(local!keys, local!inputindex)
  ),
  local!data1: if(
    a!isNullOrEmpty(local!inputindex),
    null,
    cast(
      253,
      a!forEach(
        local!data,
        createdictionary(
          local!keys2,
          property(fv!item, local!keys2, null)
        )
      )
    )
  ),
  local!data2: if(
    a!isNullOrEmpty(local!inputindex),
    null,
    cast(
      253,
      a!forEach(
        local!data,
        createdictionary(
          local!keys3,
          property(fv!item, local!keys3, null)
        )
      )
    )
  ),
  {
    if(
      a!isNullOrEmpty(local!inputindex),
      &amp;quot;Enter right keyword&amp;quot;,
      { local!data1, local!data2 }
    )
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to split a map based on user input value</title><link>https://community.appian.com/thread/145834?ContentTypeID=1</link><pubDate>Sat, 01 Mar 2025 08:28:26 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f0eedfb8-3551-4e58-aafc-9ede674a7dd2</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You can easily iterate on the input maps, and, based on conditions, create two new maps for each.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to split a map based on user input value</title><link>https://community.appian.com/thread/145830?ContentTypeID=1</link><pubDate>Sat, 01 Mar 2025 04:58:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d905e6b6-8dbd-45e3-b831-aa928453fe18</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Your requirement is unclear from here.&lt;/p&gt;
[quote userid="248371" url="~/discussions/f/new-to-appian/38616/how-to-split-a-map-based-on-user-input-value"]&lt;p&gt;I should get two&amp;nbsp;&lt;/p&gt;
&lt;p&gt;local!data1:{&lt;/p&gt;[/quote]
&lt;p&gt;Are you expecting two different dictionaries based on your input? Also what criteria are you looking at for the split.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to split a map based on user input value</title><link>https://community.appian.com/thread/145828?ContentTypeID=1</link><pubDate>Sat, 01 Mar 2025 03:13:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:16e8d78e-c5cd-41fe-84b6-40ef505ba540</guid><dc:creator>Karumuru Abhishek</dc:creator><description>&lt;p&gt;hi &lt;a href="/members/kowsalyav7826"&gt;kowsalyavijayan&lt;/a&gt;&amp;nbsp; May I know what your use case is and what you are trying to achieve&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>