<?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>Merging a map and a dictionary</title><link>https://community.appian.com/discussions/f/data/34621/merging-a-map-and-a-dictionary</link><description>I have a map and a dictionary.. How can I merge them and save the output to a datasubset?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Merging a map and a dictionary</title><link>https://community.appian.com/thread/133028?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 16:03:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4267878e-dc95-41fe-b216-0ed2385112d2</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;In general I would recommend&amp;nbsp;&lt;em&gt;always&lt;/em&gt; casting a dictionary to a map (or even constructing a map from the beginning) rather than using a dictionary. Since maps are strongly typed, they&amp;#39;re generally easier to index data and work with in your applications &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merging a map and a dictionary</title><link>https://community.appian.com/thread/132993?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 10:09:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e38c1f9-fd9d-45b2-b91a-6141efb7b75c</guid><dc:creator>p2005</dc:creator><description>&lt;p&gt;it worked.. Thank You&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merging a map and a dictionary</title><link>https://community.appian.com/thread/132992?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 10:07:15 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:90763119-8f6e-4a5a-8927-1120c595ac57</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;IN case is a list of dict...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dict: {({x: 1, y: 2}), ({x: 3, y: 4})},
  local!map: a!map(item: 1, value: &amp;quot;PRueba&amp;quot;),


  todatasubset(union(cast( a!listType(type!Map), local!dict), local!map))




)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merging a map and a dictionary</title><link>https://community.appian.com/thread/132991?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 10:05:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a2affe97-1cc3-4222-856f-e05123366ff4</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Are you using my code? Which version are you using? If not, please share it...&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:173px;max-width:481px;" alt=" " height="173" src="/resized-image/__size/962x346/__key/communityserver-discussions-components-files/16/pastedimage1712657088340v1.png" width="481" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merging a map and a dictionary</title><link>https://community.appian.com/thread/132990?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 10:01:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f8b6126c-d7d9-492d-be7f-19469e623ada</guid><dc:creator>p2005</dc:creator><description>&lt;p&gt;&amp;nbsp; if the dictionary is list?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Im getting below error with above example&lt;/p&gt;
&lt;p&gt;CastInvalidCould not cast from List of Dictionary to Map. Details: CastInvalid&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merging a map and a dictionary</title><link>https://community.appian.com/thread/132989?ContentTypeID=1</link><pubDate>Tue, 09 Apr 2024 09:23:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1d24ecd1-5945-4316-83f1-6e8871478cde</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!dict: ({x: 1, y: 2}),
  local!map: a!map(item: 1, value: &amp;quot;PRueba&amp;quot;),
  
  
  todatasubset(union(cast(type!Map, local!dict), local!map))
  
  
  
  
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>