<?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>Function</title><link>https://community.appian.com/discussions/f/general/28926/function</link><description>What Is a function for showing array itoem in ascending or descending</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Function</title><link>https://community.appian.com/thread/114644?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2023 14:06:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:311a8253-4151-4ca2-9431-a19046d1f5b3</guid><dc:creator>christopherb5894</dc:creator><description>&lt;p&gt;Thank you sir, I will try it. If I face any issue, I will message you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114156?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 14:07:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6b4384b-b49e-4d72-958c-4d90a93c0a6e</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="3520" url="~/discussions/f/general/28926/function/114129#114129"]Also being able to declare which item in, say, a map you want to sort by would be useful, as would nested sort orders [/quote]
&lt;p&gt;Yeah, this is usually the biggest reason why sort() isn&amp;#39;t very useful - since it&amp;#39;s almost completely useless for sorting via the value of a particular field of a cdt/dictionary/map, and requires some hoops to jump through in some other even fairly simple use cases for no particularly good reason.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114139?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 11:35:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4cfdf40c-2753-41c5-a4ff-a60aea8c28c4</guid><dc:creator>liyakatp2746</dc:creator><description>&lt;p&gt;Thanks to all&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114132?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:54:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:21a57ed1-31f5-4217-910c-8e48e0da97dc</guid><dc:creator>Mathieu Drouin</dc:creator><description>&lt;p&gt;This is the best way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114129?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:44:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:21a6233c-b33b-437b-8d0d-ee816b8886e7</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Agreed. It would be good to see it evolved so that you could declare the desired sort order (right now you have to sort and then use fn!inverse() to get a descending-order result. Also being able to declare which item in, say, a map you want to sort by would be useful, as would nested sort orders (e.g. sort by A, then E, then C, then D in a map that had keys of A, B ,C D, E)&lt;/p&gt;
&lt;p&gt;Right now sort() if not officially supported so if you use it and there&amp;#39;s an issue after, say, an upgrade, you won&amp;#39;t get any support from Appian to address you issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114126?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:37:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:be07e013-6cbf-4627-b79a-09107930dd92</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;Yupp! I know that pretty well. Just one of many requests which we have from Appian.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114124?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:30:54 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:03b968ed-81bc-4667-bca6-c5bb7a57500c</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;I hope you know you shouldn&amp;#39;t be using undocumented functions.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114122?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 10:26:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f36b8b9c-b2f7-4886-9e3e-da751db38f56</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;You can also use&amp;nbsp;&lt;a href="/b/appmarket/posts/sort-utilities"&gt;Sort Utilities&lt;/a&gt;&amp;nbsp;plugin, only if you are&amp;nbsp;okay with dependency on a custom plugin.&lt;/p&gt;
&lt;p&gt;However, I believe it is high time Appian should introduce OOTB &lt;strong&gt;documented&lt;/strong&gt; version of the hidden sort() function, instead of forcing us to first convert the data into key value pairs and then use todatasubset and pagingInfo just to apply sorting to a list of numbers.&lt;/p&gt;
&lt;p&gt;Hidden sort() function:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="84" src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1686564542961v1.png" width="114" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Function</title><link>https://community.appian.com/thread/114099?ContentTypeID=1</link><pubDate>Mon, 12 Jun 2023 09:45:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:51797764-cc2c-406d-8a3e-d136b4544acd</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;There is no direct function. You can use todatasubset() paired with sortInfo() to get the desired result.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!array: a!forEach(
    items: ri!array,
    expression: { utls: fv!item }
  ),
  todatasubset(
    arrayToPage: local!array,
    pagingConfiguration: a!pagingInfo(
      startIndex: 1,
      batchSize: - 1,
      sort: a!sortInfo(field: &amp;quot;utls&amp;quot;, ascending: ri!isAscending)
    )
  ).data.utls
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>