Filtering a List View in Freedom UI

Hello All!

 

I have made multiple attempts at filtering a dashboard list through code, but have been unsuccessful in my attempts. I'm assuming the process would be the same for custom filtering any list view, but I am specifically working with a List in a dashboard. The default filters do not work in my case, and I am looking for guidance on how to dynamically filter the records that are displayed in a list on a dashboard. I have already looked through numerous other posts as well as Freedom UI related videos and found multiple examples of filtering other components such as lookups, but nothing seems to carry over to the list view. Please help! A simple example would be immensely helpful in pointing me in the right direction.

 

Thank you!

Chris

Like 1

Like

3 comments

Unfortunately, we don't have ready-made examples of implementing such filtering. However, you can build such a filter using the following code as an example:

 



 

"attributes": {

..

                "DataGrid_d7k1ikp": {

                    "isCollection": true,

                    "modelConfig": {

                        "path": "DataGrid_d7k1ikpDS",

                        "filterAttributes": [

                            {

                                "loadOnChange": true,

                                "name": "DataGrid_d7k1ikp_PredefinedFilter"

                            }

                        ]

                    },

 

 

DataGrid_d7k1ikp_PredefinedFilter leads us to the attributes:

 

"DataGrid_d7k1ikp_PredefinedFilter": {

                    "value": {

                        "items": {

                            "a2376c0c-0b3f-451a-9085-0a65ae58bab8": {

                                "filterType": 4,

                                "comparisonType": 3,

                                "isEnabled": true,

                                "trimDateTimeParameterToDate": false,

                                "leftExpression": {

                                    "expressionType": 0,

                                    "columnPath": "Account"

                                },

                                "isAggregative": false,

                                "dataValueType": 10,

                                "referenceSchemaName": "Account",

                                "rightExpressions": [

                                    {

                                        "expressionType": 2,

                                        "parameter": {

                                            "dataValueType": 10,

 

...

 

If you need to build a dynamic filter, you should look in this direction. Create a custom attribute, populate it when loading the record (in the LoadDataRequest handler), and use it in the code of the DataGrid_d7k1ikp_PredefinedFilter filter.

If you have doubts about how to correctly construct paths to columns, please follow these steps: navigate to the section with this list, create an advanced filter, find the SelectQuery in the browser's Network tab, and copy the filters from the request body.



Best regards, Pavlo!

Hey Pavlo,

 

Thank you for your guidance and recommendations. Unfortunately they do not seem to work for what I am attempting to implement. The main issue I believe occurring is that the attribute is not being referenced correctly in the predefined filter. I have referenced it in the same way as I have found in other examples("$AttributeName"), but this does not seem to work.

 

If anyone can provide any guidance on how to filter a list dashboard in Freedom UI it would be super helpful! I have attempted many different routes for filtering the list dashboard, but none have worked. I need to add a custom filter through code, as the quick filter does not work for what I need.

 

Thank you in advance!

Chris

Hey Pavlo,

Thank you for your guidance and recommendations. Unfortunately they do not seem to work for what I am attempting to implement. The main issue I believe occurring is that the attribute is not being referenced correctly in the predefined filter. I have referenced it in the same way as I have found in other examples("$AttributeName"), but this does not seem to work.

If anyone can provide any guidance on how to filter a list dashboard in Freedom UI it would be super helpful! I have attempted many different routes for filtering the list dashboard, but none have worked. I need to add a custom filter through code, as the quick filter does not work for what I need.

Thank you in advance!

Chris

Show all comments