Comments

8 comments

  • Avatar
    Adarsh S

    i need these values in the indicator widget from dashboard 

    can anyone hlp me its needful

     

    0
    Comment actions Permalink
  • Avatar
    Nathan Giusti

    Here's a script that prints out all the filters in the dashboard. Modify as necessary. 

     

    widget.on("initialized", function (se, args){

    prism.activeDashboard.filters.$$items.forEach((itemFilter) =>

    {

    console.log(itemFilter.jaql.filter.members))
    }
    })

     

     

    1
    Comment actions Permalink
  • Avatar
    Adarsh S

    Thanks @Nathan Giusti

    0
    Comment actions Permalink
  • Avatar
    Sudha Kothari

    Hi Nathan/Adarsh, 

    Its gives me undefined. Its not able to get jaql object and hence the objects within it.

    Even filter.members doesn't work. Any help is appreciated.

     

    Regards,

    Sudha.

    0
    Comment actions Permalink
  • Avatar
    Nathan Giusti

    Can you post your code Sudha?

    Thanks, 

    Nathan

    0
    Comment actions Permalink
  • Avatar
    Stephen McCready

    I copied Nathan's code from 7/31/2019 into a Dashboard script but there was an error with a misplaced ")".

    After fixing that I got "ReferenceError: widget is not defined"

    So a moved the code into a Widget script of a widget contained within the dashboard and it kinda worked.  

    The dashboard has 2 filters, a date and a pick list of 6 options (lines of business).

    The date filter value is displayed on the console perfectly

    But the pick list values are displayed as "undefined"

     

    I'll keep fiddling with it, if anyone has any other ideas please post - cheers

     

    Here's the amended code I used:

    widget.on("initialized", function (se, args){

    prism.activeDashboard.filters.$$items.forEach(

    (itemFilter) =>{

    console.log(itemFilter.jaql.filter.members)

    }

    )
    })

    0
    Comment actions Permalink
  • Avatar
    Nathan Giusti

    Hey Stephen, 

    Sorry for the typo. 

    If you want to put it in a widget script you'd use the widget.on syntax. If you want it in a dashboard script, you would use the dashboard.on syntax

    Members only has values if you are filtering for a specific value. The exact structure for the itemFilter.jaql.filter object changes depending on the filter selected. It may be worth running something like

    dashboard.on("initialized", function (se, args){

    prism.activeDashboard.filters.$$items.forEach((itemFilter) =>

    {
    console.log(itemFilter.jaql.filter)
    }
    )})

    And looking at the results in your console to see what structure the filters you are looking at are in. 

    1
    Comment actions Permalink
  • Avatar
    Stephen McCready (Edited )

    Thanks @Nathan Giusti , that worked

    0
    Comment actions Permalink

Please sign in to leave a comment.