<?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>Converting a map of objects to an array of CDTs</title><link>https://community.appian.com/discussions/f/new-to-appian/19797/converting-a-map-of-objects-to-an-array-of-cdts</link><description>Hi 
 I&amp;#39;ve recently been experimenting with with Grid components. I&amp;#39;m currently using the read-only grid and it&amp;#39;s `fv!selectedRows` variable to pull out the full object of data from each object selected. 
 `fv!selectedRows` returns a map of objects, but</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Converting a map of objects to an array of CDTs</title><link>https://community.appian.com/thread/77449?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 20:22:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f5cc4cc5-9b10-4451-9e33-df17d4d2a0bc</guid><dc:creator>Peter Lewis</dc:creator><description>&lt;p&gt;That should work, but you can also eliminate one of the saves if you directly cast the data in your append and difference functions above like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;selectionSaveInto: {
  local!selection,
  a!save(
    ri!case, append(
      ri!case, cast(
        &amp;#39;type!{urn:com:appian:types:PDL}PDL_Client?list&amp;#39;,
        fv!selectedRows
      )
    )
  ),
  a!save(
    ri!case, 
    difference(
      ri!case, 
      cast(
        &amp;#39;type!{urn:com:appian:types:PDL}PDL_Client?list&amp;#39;,
        fv!deselectedRows
      )
    )
  )
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Converting a map of objects to an array of CDTs</title><link>https://community.appian.com/thread/77435?ContentTypeID=1</link><pubDate>Mon, 26 Oct 2020 09:30:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f8c61da6-e017-416f-86a6-7e8c211389ca</guid><dc:creator>dextermb</dc:creator><description>&lt;p&gt;I&amp;#39;m currently doing the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!save(
  target: local!SelectedRows,
  value: save!value
),
a!save(
  target: local!SelectedSites,
  value: append(local!SelectedSites, fv!selectedRows)
),
a!save(
  target: local!SelectedSites,
  value: difference(local!SelectedSites, fv!deselectedRows)
),
a!save(
  target: ri!SelectedSites,
  value: a!forEach(
    items: local!SelectedSites,
    expression: cast(&amp;#39;type!Site&amp;#39;, fv!item)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>