Dashboards & Visualizations

Hide/Display panel based on dropdown selection in dashboard studio

Poojitha
Path Finder


Hi All,

I have a dropdown as below in dashboard studio

Poojitha_1-1721268597884.png

I also have a table that has options - All, active groups and inactive groups. 

If user clicks on "Inactive groups", it should display table that has details of inactive groups, if user clicks on Active groups table with active groups should be displayed. If user clicks on All, then all groups should be displayed. Until any of above chosen table should be hidden. 

I have selected "When data is unavailable, hide element" option under visibility in configuration. But I am not getting how to achieve my above use cases. Please can anyone of you help me on this. 

Thanks,
PNV

 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Here is a simple mockup demonstrating the feature

{
    "visualizations": {
        "viz_WuaoFRne": {
            "type": "splunk.table",
            "dataSources": {
                "primary": "ds_67f8SogQ"
            },
            "hideWhenNoData": true
        }
    },
    "dataSources": {
        "ds_67f8SogQ": {
            "type": "ds.search",
            "options": {
                "query": "| makeresults count=10\n| eval group=mvindex(split(\"Inactive,Active\",\",\"),random()%2)\n| eval groupId=\"Group \".random()%9\n| search group=\"$groups$\""
            },
            "name": "groups"
        }
    },
    "defaults": {
        "dataSources": {
            "ds.search": {
                "options": {
                    "queryParameters": {
                        "latest": "$global_time.latest$",
                        "earliest": "$global_time.earliest$"
                    }
                }
            }
        }
    },
    "inputs": {
        "input_global_trp": {
            "type": "input.timerange",
            "options": {
                "token": "global_time",
                "defaultValue": "-24h@h,now"
            },
            "title": "Global Time Range"
        },
        "input_hM19F0Rl": {
            "options": {
                "items": [
                    {
                        "label": "All",
                        "value": "*"
                    },
                    {
                        "label": "Inactive groups",
                        "value": "Inactive"
                    },
                    {
                        "label": "Active groups",
                        "value": "Active"
                    }
                ],
                "token": "groups"
            },
            "title": "Display",
            "type": "input.dropdown"
        }
    },
    "layout": {
        "type": "absolute",
        "options": {
            "width": 1440,
            "height": 960,
            "display": "auto"
        },
        "structure": [
            {
                "item": "viz_WuaoFRne",
                "type": "block",
                "position": {
                    "x": 0,
                    "y": 0,
                    "w": 830,
                    "h": 300
                }
            }
        ],
        "globalInputs": [
            "input_global_trp",
            "input_hM19F0Rl"
        ]
    },
    "description": "",
    "title": "Hidden"
}

If you are still having problems please share you dashboard source code in a code block </> (as demonstrated above).

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...