{"id":27962,"date":"2021-05-21T13:13:33","date_gmt":"2021-05-21T13:13:33","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=27962"},"modified":"2021-09-01T10:02:48","modified_gmt":"2021-09-01T10:02:48","slug":"how-to-sort-dataset-in-pcf-control","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/","title":{"rendered":"How to Sort Dataset in PCF Control?"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &#8220;sorting&#8221; which we can use to sort records according to a particular column in ascending or descending order.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27963 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg\" alt=\"Sort Dataset in PCF Control\" width=\"1137\" height=\"400\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg 1137w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control-300x106.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control-768x270.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control-1024x360.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control-660x232.jpeg 660w\" sizes=\"(max-width: 1137px) 100vw, 1137px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">To keep dataset designing simple and easy to understand we will be using the React Fluent UI framework&#8217;s &#8220;DetailList-Basic&#8221; control in our example. You can also use simple HTML, Javascript, and CSS for dataset grid as per the design.<\/p>\n<p style=\"text-align: justify;\">As we are using DetailList, the &#8216;onColumnClick&#8217; event has parameter that represents the column which is clicked. On this event, we can write the below code:<\/p>\n<p>\/\/ when a column header is clicked sort the items<br \/>\nconst _onColumnClick = (ev?: React.MouseEvent, column?: any): void =&gt; {<br \/>\nlet dataset = props.pcfContext.parameters.sampleDataSet;<br \/>\nconst newValue: any = {<br \/>\nname: column.fieldName,<br \/>\nsortDirection: column.isSortedDescending ? 0 : 1<br \/>\n}<br \/>\nwhile (dataset.sorting.length &gt; 0) {<br \/>\ndataset.sorting.pop();<br \/>\n}<br \/>\ndataset.sorting.push(newValue);<br \/>\n(dataset.paging as any).loadExactPage(1);<br \/>\ndataset.refresh();<br \/>\nlet isSortedDescending = !column?.isSortedDescending;<br \/>\nsetItems(dataset.sorting);<br \/>\nsetColumns(<br \/>\ncolumns.map(col =&gt; {<br \/>\ncol.isSorted = col.key === column?.key;<br \/>\ncol.isSortedDescending = isSortedDescending;<br \/>\nreturn col;<br \/>\n})<br \/>\n);<br \/>\n}<\/p>\n<p style=\"text-align: justify;\">In the above code, we first need to get the current sorting direction of the selected column after which we can change it in the opposite direction. For example, if the current direction is &#8216;ascending&#8217; then we will change it into &#8216;descending&#8217; and vice versa. For that, we need to check dataset.sorting. To change the current SortStatus of the dataset column, we have to pass the object that contains the name (the name of the column) and sortDirection (the current sort direction of the column).<\/p>\n<p><strong>SORTDIRECTION<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<th>Value<\/th>\n<th>Member<\/th>\n<\/tr>\n<tr>\n<td>-1<\/td>\n<td>None<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>Ascending<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>Descending<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"text-align: justify;\">After changing the SortStatus, we need to call dataset.refresh(), otherwise, there will be no desired effect.<\/p>\n<p style=\"text-align: justify;\">Also, we have to navigate to the first page if we want that sorting to be applied to the entire dataset instead of applied only for dataset visible on the same page.<\/p>\n<p>dataset.sorting.push(newValue);<br \/>\n(dataset.paging as any).loadExactPage(1);<br \/>\ndataset.refresh();<\/p>\n<h2>Conclusion<\/h2>\n<p style=\"text-align: justify;\">By using Sorting, we can easily sort records in the PCF control dataset for a particular column in ascending\/descending order.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/click-2-clone-microsoft-dynamics-crm-records\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-27964 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/c2c-2.jpg\" alt=\"click2clone\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/c2c-2.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/c2c-2-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/c2c-2-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/c2c-2-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &#8220;sorting&#8221; which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/\">Read More: How to Sort Dataset in PCF Control? &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1929],"tags":[1941,2279],"class_list":["post-27962","post","type-post","status-publish","format-standard","hentry","category-pcf","tag-pcf-control","tag-sort-dataset"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &quot;sorting&quot; which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Inogic\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta property=\"og:description\" content=\"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &quot;sorting&quot; which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1137\" \/>\n\t\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2021-05-21T13:13:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2021-09-01T10:02:48+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inogicindia\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &quot;sorting&quot; which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@inogic\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg\" \/>\n\t\t<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t\t<meta name=\"twitter:data1\" content=\"Inogic\" \/>\n\t\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#blogposting\",\"name\":\"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks\",\"headline\":\"How to Sort Dataset in PCF Control?\",\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/How-to-Sort-Dataset-in-PCF-Control.jpeg\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#articleImage\",\"width\":1137,\"height\":400,\"caption\":\"Sort Dataset in PCF Control\"},\"datePublished\":\"2021-05-21T13:13:33+05:30\",\"dateModified\":\"2021-09-01T10:02:48+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#webpage\"},\"articleSection\":\"PCF, PCF Control, Sort Dataset\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/#listItem\",\"name\":\"Microsoft PowerApps\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/#listItem\",\"position\":2,\"name\":\"Microsoft PowerApps\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/pcf\\\/#listItem\",\"name\":\"PCF\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/pcf\\\/#listItem\",\"position\":3,\"name\":\"PCF\",\"item\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/pcf\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#listItem\",\"name\":\"How to Sort Dataset in PCF Control?\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/#listItem\",\"name\":\"Microsoft PowerApps\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#listItem\",\"position\":4,\"name\":\"How to Sort Dataset in PCF Control?\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/category\\\/power-apps\\\/pcf\\\/#listItem\",\"name\":\"PCF\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"By Inogic\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/inogic-logo.png\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#organizationLogo\",\"width\":1000,\"height\":325,\"caption\":\"inogic logo\"},\"image\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#organizationLogo\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/inogicindia\",\"https:\\\/\\\/twitter.com\\\/inogic\",\"https:\\\/\\\/www.instagram.com\\\/inogicindia\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCM4V7ousgLSu1hbOEv4DUuQ\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/inogicindia\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/\",\"name\":\"Inogic\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Inogic\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#webpage\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/\",\"name\":\"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks\",\"description\":\"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property \\\"sorting\\\" which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/2021\\\/05\\\/how-to-sort-dataset-in-pcf-control\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/author\\\/inogic-2\\\/#author\"},\"datePublished\":\"2021-05-21T13:13:33+05:30\",\"dateModified\":\"2021-09-01T10:02:48+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/\",\"name\":\"Microsoft Dynamics 365 CRM Tips and Tricks\",\"alternateName\":\"Inogic\",\"description\":\"By Inogic\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.inogic.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property \"sorting\" which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be","canonical_url":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#blogposting","name":"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks","headline":"How to Sort Dataset in PCF Control?","author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#articleImage","width":1137,"height":400,"caption":"Sort Dataset in PCF Control"},"datePublished":"2021-05-21T13:13:33+05:30","dateModified":"2021-09-01T10:02:48+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#webpage"},"isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#webpage"},"articleSection":"PCF, PCF Control, Sort Dataset"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.inogic.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/#listItem","name":"Microsoft PowerApps"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/#listItem","position":2,"name":"Microsoft PowerApps","item":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/pcf\/#listItem","name":"PCF"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/pcf\/#listItem","position":3,"name":"PCF","item":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/pcf\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#listItem","name":"How to Sort Dataset in PCF Control?"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/#listItem","name":"Microsoft PowerApps"}},{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#listItem","position":4,"name":"How to Sort Dataset in PCF Control?","previousItem":{"@type":"ListItem","@id":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/pcf\/#listItem","name":"PCF"}}]},{"@type":"Organization","@id":"https:\/\/www.inogic.com\/blog\/#organization","name":"Microsoft Dynamics 365 CRM Tips and Tricks","description":"By Inogic","url":"https:\/\/www.inogic.com\/blog\/","logo":{"@type":"ImageObject","url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2023\/02\/inogic-logo.png","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#organizationLogo","width":1000,"height":325,"caption":"inogic logo"},"image":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#organizationLogo"},"sameAs":["https:\/\/www.facebook.com\/inogicindia","https:\/\/twitter.com\/inogic","https:\/\/www.instagram.com\/inogicindia\/","https:\/\/www.youtube.com\/channel\/UCM4V7ousgLSu1hbOEv4DUuQ","https:\/\/www.linkedin.com\/company\/inogicindia"]},{"@type":"Person","@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author","url":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/","name":"Inogic","image":{"@type":"ImageObject","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/839d9ae7d2b941d2d09e91df322267a429821f2ce5494302b53bd5ca3679f1a0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Inogic"}},{"@type":"WebPage","@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#webpage","url":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/","name":"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks","description":"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property \"sorting\" which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.inogic.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/#breadcrumblist"},"author":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"creator":{"@id":"https:\/\/www.inogic.com\/blog\/author\/inogic-2\/#author"},"datePublished":"2021-05-21T13:13:33+05:30","dateModified":"2021-09-01T10:02:48+05:30"},{"@type":"WebSite","@id":"https:\/\/www.inogic.com\/blog\/#website","url":"https:\/\/www.inogic.com\/blog\/","name":"Microsoft Dynamics 365 CRM Tips and Tricks","alternateName":"Inogic","description":"By Inogic","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.inogic.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Microsoft Dynamics 365 CRM Tips and Tricks - By Inogic","og:type":"article","og:title":"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks","og:description":"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &quot;sorting&quot; which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be","og:url":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/","og:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg","og:image:secure_url":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg","og:image:width":1137,"og:image:height":400,"article:published_time":"2021-05-21T13:13:33+00:00","article:modified_time":"2021-09-01T10:02:48+00:00","article:publisher":"https:\/\/www.facebook.com\/inogicindia","twitter:card":"summary_large_image","twitter:site":"@inogic","twitter:title":"How to Sort Dataset in PCF Control? - Microsoft Dynamics 365 CRM Tips and Tricks","twitter:description":"Introduction In this blog, we will see how we can sort records in the dataset in PCF control. The dataset object does have the property &quot;sorting&quot; which we can use to sort records according to a particular column in ascending or descending order. To keep dataset designing simple and easy to understand we will be","twitter:creator":"@inogic","twitter:image":"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/05\/How-to-Sort-Dataset-in-PCF-Control.jpeg","twitter:label1":"Written by","twitter:data1":"Inogic","twitter:label2":"Est. reading time","twitter:data2":"2 minutes"},"aioseo_meta_data":{"post_id":"27962","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"BlogPosting","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2023-02-02 05:50:39","updated":"2025-07-04 08:32:05","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/power-apps\/\" title=\"Microsoft PowerApps\">Microsoft PowerApps<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.inogic.com\/blog\/category\/power-apps\/pcf\/\" title=\"PCF\">PCF<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Sort Dataset in PCF Control?\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.inogic.com\/blog"},{"label":"Microsoft PowerApps","link":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/"},{"label":"PCF","link":"https:\/\/www.inogic.com\/blog\/category\/power-apps\/pcf\/"},{"label":"How to Sort Dataset in PCF Control?","link":"https:\/\/www.inogic.com\/blog\/2021\/05\/how-to-sort-dataset-in-pcf-control\/"}],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/27962","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=27962"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/27962\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=27962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=27962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=27962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}