Forum Discussion

prakashp's avatar
prakashp
Cloud Apps
02-22-2023

Searchable Input Text That Displays the Value Selected

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

 

 

1 Reply

Replies have been turned off for this discussion
  • 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