<?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>change the result of the map data</title><link>https://community.appian.com/discussions/f/general/38275/change-the-result-of-the-map-data</link><description>Map 
 
 
 
 
 mail List of Text String - 3 items 
 
 
 &amp;quot;test@gmail.com:1&amp;quot; (Text) 
 
 
 
 &amp;quot;test2@gmail.com:3&amp;quot; (Text) 
 
 
 
 &amp;quot;test3@gmail.com:3&amp;quot; (Text) 
 
 
 
 
 
 period &amp;quot;01/2024&amp;quot; (Text) 
 
 
 
 
 
 
 
 Map 
 
 
 mail &amp;quot;test4@gmail.com:4&amp;quot;(Text) 
 
 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: change the result of the map data</title><link>https://community.appian.com/thread/144230?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 16:06:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2d55750d-8e7b-4150-a19a-7e832585c7a1</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;p&gt;Hi Mufeeda,&lt;br /&gt;In your example data i can see multiple periods ,but in output you want only one ? if yes then what is the period id that you want ? if no then as I mentioned above we can not have duplicate keys.&lt;br /&gt;&lt;br /&gt;below is the code for getting all the unique period valus&amp;nbsp;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1736438781958v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!returnedDataFromRule: {
    a!map(
      mail: {
        &amp;quot;test1@gamil.com:1&amp;quot;,
        &amp;quot;test2@gamil.com:2&amp;quot;,
        &amp;quot;test3@gamil.com:3&amp;quot;
      },
      period: &amp;quot;01/2024&amp;quot;
    ),
    a!map(
      mail: { &amp;quot;test@gamil.com:4&amp;quot;},
      period: &amp;quot;01/2024&amp;quot; 
      
    )
  },
  local!keysAndValues: a!forEach(
    items: a!flatten(
      property(local!returnedDataFromRule, &amp;quot;mail&amp;quot;, &amp;quot;&amp;quot;)
    ),
    expression: a!map(
      key: split(fv!item, &amp;quot;:&amp;quot;)[1],
      value: split(fv!item, &amp;quot;:&amp;quot;)[2]
    )
  ),
  local!periods: a!flatten(
    property(local!returnedDataFromRule, &amp;quot;period&amp;quot;, &amp;quot;&amp;quot;)
  ),
  local!emails: a!update(
    data: a!map(),
    index: {
      property(local!keysAndValues, &amp;quot;key&amp;quot;, &amp;quot;&amp;quot;),
      
    },
    value: {
      property(local!keysAndValues, &amp;quot;value&amp;quot;, &amp;quot;&amp;quot;),
      
    }
  ),
  a!update(
    data: local!emails,
    index: &amp;quot;period&amp;quot;,
    value: union(local!periods,local!periods)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change the result of the map data</title><link>https://community.appian.com/thread/144209?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 11:21:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7fd728c6-13ed-474e-999e-7aca9d700b9b</guid><dc:creator>mufeeda0001</dc:creator><description>&lt;p&gt;Hi Eren,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the reply, I need Period value Aswell along with emails&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;for example,&amp;nbsp;&lt;/p&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;test@gmail.com:1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;test@gmail.com:1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;test@gmail.com:1&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_key"&gt;period&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;01/2024&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;Thanks in Advance.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change the result of the map data</title><link>https://community.appian.com/thread/144200?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 07:52:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e8080d86-3e2c-4843-b1dd-43cd13a168bd</guid><dc:creator>EREN_YEAGER</dc:creator><description>&lt;ul&gt;
&lt;li&gt;Duplicate keys are not allowed in a map or dictionary.&lt;/li&gt;
&lt;li&gt;You can use the &lt;code&gt;a!update()&lt;/code&gt; function to create dynamic keys, as Stefan mentioned in his reply. You can refer to this example for guidance.&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1736409117851v1.png" /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!returnedDataFromRule: {
    a!map(
      mail: {
        &amp;quot;test1@gamil.com:1&amp;quot;,
        &amp;quot;test2@gamil.com:2&amp;quot;,
        &amp;quot;test3@gamil.com:3&amp;quot;
      },
      period: &amp;quot;01/2024&amp;quot;
    ),
    a!map(
      mail: { &amp;quot;test@gamil.com:4&amp;quot;,  },
      period: &amp;quot;01/2024&amp;quot;
    )
  },
  local!keysAndValues: a!forEach(
    items: a!flatten(
      property(local!returnedDataFromRule, &amp;quot;mail&amp;quot;, &amp;quot;&amp;quot;)
    ),
    expression: a!map(
      key: split(fv!item, &amp;quot;:&amp;quot;)[1],
      value: split(fv!item, &amp;quot;:&amp;quot;)[2]
    )
  ),
  a!update(
    data: a!map(),
    index: { property(local!keysAndValues, &amp;quot;key&amp;quot;, &amp;quot;&amp;quot;) },
    value: {
      property(local!keysAndValues, &amp;quot;value&amp;quot;, &amp;quot;&amp;quot;),
      
    }
  ),
  
)&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change the result of the map data</title><link>https://community.appian.com/thread/144198?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 07:29:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2bda65a7-1435-4e10-ac0a-55bdf002c14e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You can use the a!update() function to create a map with dynamic key names.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1736407765084v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: change the result of the map data</title><link>https://community.appian.com/thread/144195?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2025 07:00:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:454e4c4e-ab2a-4fbc-a2e6-a3f0fb597d9b</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;Would be in better position to help if you paste the code responsible or explain the output better. Example, first map has 3 emails in it but the expected output you are expecting has just the first email but thrice (why?) and what happens to the other two emails within first map&amp;nbsp;&lt;/p&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;test2@gmail.com:3&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;
&lt;ul class="SelectableTreeNode---componentConfigParam"&gt;&lt;/ul&gt;
&lt;ul class="SelectableTreeNode---nonComponentConfigParam"&gt;&lt;/ul&gt;
&lt;/li&gt;
&lt;li class="SelectableTreeNode---selectableTreeNode SelectableTreeNode---leaf SelectableTreeNode---open SelectableTreeNode---allow_text_highlighting"&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;test3@gmail.com:3&amp;quot;&lt;/span&gt;&lt;span class="CollapsibleOutputNode---print_element_type"&gt;(Text)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>