cancel
Showing results for 
Search instead for 
Did you mean: 

Searchable Input Text That Displays the Value Selected

prakashp
8 - Cloud Apps
8 - Cloud Apps

Hi,

I need to have a searchable input text (see image attached) that say searches by country name (a field in a dimension table). 
Once I type in say "Australia" and hit "Apply", the dashboard should filter accordingly. The key requirement is for the input text to display "Australia" showing my selection. Would appreciate a script to enable this functionality. 

Thanks in advance

prakashp_0-1677029045551.png

 

 

1 REPLY 1

Alek_qbeeq
9 - Travel Pro
9 - Travel Pro

Hey @prakashp

If it has to be text input, you can do something like this: 

{
    "style": {},
    "script": "var found = prism.activeDashboard.filters.$$items.find(element => element.jaql.title == 'Country'); var filterMember = found.jaql.filter.members[0];$('.tester').val(`${filterMember}`)",
    "title": "",
    "titleStyle": [
        {
            "display": "none"
        }
    ],
    "showCarousel": true,
    "carouselAnimation": {
        "showButtons": false
    },
    "body": [
        {
            "type": "Container"
        },
        {
            "type": "ColumnSet",
            "separator": false,
            "spacing": "default",
            "columns": [
                {
                    "type": "Column",
                    "width": "170px",
                    "items": []
                },
                {
                    "type": "Column",
                    "spacing": "none",
                    "width": "175px",
                    "items": [
                        {
                            "type": "Container",
                            "spacing": "none",
                            "width": "150px",
                            "items": [
                                {
                                    "type": "Input.Text",
                                    "id": "data.filters[0].filterJaql.members[0]",
                                    "class": "tester",
                                    "value": "Search Country by Name",
                                    "displayType": "compact",
                                    "style": {
                                        "margin-top": "30px"
                                    }
                                }
                            ]
                        }
                    ]
                },
                {
                    "type": "Column",
                    "spacing": "none",
                    "width": "175px",
                    "items": [
                        {
                            "type": "Container",
                            "spacing": "none",
                            "width": "80px",
                            "items": [
                                {
                                    "type": "ActionSet",
                                    "margin": "0px",
                                    "padding": "0px",
                                    "style": {
                                        "margin-top": "30px"
                                    },
                                    "actions": [
                                        {
                                            "type": "Filters",
                                            "title": "Apply",
                                            "data": {
                                                "filters": [
                                                    {
                                                        "filterName": "Country",
                                                        "filterJaql": {
                                                            "explicit": true,
                                                            "members": [
                                                                ""
                                                            ]
                                                        }
                                                    }
                                                ]
                                            }
                                        }
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "actions": []
}

Let me know if it fits your requirments.

Another more robust option would be to utilize the powerful QBeeQ Advanced Filter plugin which is by far the best filtering solution available for Sisense. This plugin allows you to create advanced customized filters on the dashboard area itself, thus taking better advantaged of dashboard real estate, and allows searching, filter buttons, advanced date range options, custom look and feel and much much more,Please do not hesitate to reach out to see a live demo, or if we can help in any way, we’re always here to help 

 

Always here to help,
Alek from QBeeQ

QBeeQ - Gold Implementation and Development Partner
www.qbeeq.io