<?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 can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/discussions/f/general/26116/how-can-we-get-1st-index-elements-of-each-array-in-different-new-array</link><description>How can we get 1st index elements of each array in different new array. Like {2,13,65} {7,15,45} {14,3,56} So output of 1st elements should be {2,7,14} And for 2nd and 3rd {13,15,3} {65,45,56}</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/thread/143817?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2024 00:05:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:047ef2ca-a6fe-4bef-9b5c-a39df1b17141</guid><dc:creator>sureshkumarj8140</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
local!merger: merge({ 2, 13, 65 }, { 7, 15, 45 }, { 14, 3, 56 }),
local!merger
)&lt;/pre&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1734653037524v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/thread/102326?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 05:38:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:354e304a-dc9f-4a10-affe-fd129d2edf95</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Ah, okay! Then it makes sense.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/thread/102325?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 05:34:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9839248-b088-42f5-8536-ba566cbff2db</guid><dc:creator>Amaan Shekh</dc:creator><description>&lt;p&gt;Sir, as he said in the question that he wants n(3) arrays accordingly .. so I thought what if the arrays are {1,2,3,4,.....,n}&amp;nbsp;... So i&amp;#39;ve edited your code with one extra loop in which he can put the number of required arrays for output.&amp;nbsp;&lt;br /&gt;&amp;nbsp; eg - [1,2,3] , [2,4,6], [4,8,9]&amp;nbsp; should be [1,2,4],[2,4,8],[3,6,9]&amp;nbsp;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;so i&amp;#39;ve added an extra loop for getting all the arrays as - if you put 2 in the first loop than you can get only [1,2,4],[2,4,6]. and same will work for the n times with a index function also.&lt;br /&gt;please correct me if I&amp;#39;m wrong&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/thread/102324?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 05:21:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:76fa6d83-f054-47e7-9b9f-0d8269982dc9</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;What is the point of copy-pasting the entire code but with increased complexity - one more a!forEach()? That just adds more executing time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/thread/102323?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 05:05:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5936cc8b-f4c1-4c57-9ad3-0295352cb623</guid><dc:creator>Amaan Shekh</dc:creator><description>&lt;p&gt;for getting all the three arrays as desired/required&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!array:{
    {
      list: {2,13,65}
    },
    {
      list: {7,15,45}
    },
    {
      list: {14,3,56}
    },
    {
      list: {1,2,3}
    }

  },
  a!forEach(
    items:enumerate(3)+1,  /* three is the no. arrays you have to make/ output arrays */
    expression: a!localVariables(
      local!temp:fv!item,
      a!forEach(
    items: local!array,
    expression: fv!item.list[local!temp]
  )))
)&lt;/pre&gt;This 3 should not pass the minimun no. of elements(fg-3) in any any list of the array .&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we get 1st index elements of each array in different new array</title><link>https://community.appian.com/thread/102321?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2022 04:52:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5066b811-6357-46be-a006-78161e01cbc7</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Appian doesn&amp;#39;t really understand list of list and therefore it will flatten them into one big array. You might have to cast it in a dictionary so it can iterate on that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!array:{
    {
      list: {2,13,65}
    },
    {
      list: {7,15,45}
    },
    {
      list: {14,3,56}
    }
    
  },
  a!forEach(
    items: local!array,
    expression: fv!item.list[1]
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can change the value of 1 to your desired index.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>