Forum Discussion

Sly's avatar
Sly
Data Storage
09-30-2022

issue creating a dropdown filter

Hi i have been trying to create a dropdown filter for over 600 campaigns but seem to have an issue once i have imported the template as it defaults back to the Blox template "Welcome to Blox" the code is not saved on the imported template and also doesnt work once i just try copy it and work on the javascript. 

please kindly assist 🙂 

9 Replies

Replies have been turned off for this discussion
  • Sly's avatar
    Sly
    Data Storage

    i have been able to add the template now but once i change the code it still doesnt output the dropdown 

  • HamzaJ's avatar
    HamzaJ
    Data Integration

    HI Sly 

    It would be helpfull if you could share your blox-script. In your first post it sounds like the JSON is not valid (a comma to much or a ) to little and it reverts back). Seems you have fixed that. If you can share your script I can have a look at the dropdown.

    • Sly's avatar
      Sly
      Data Storage

      Hi HamzaJ  thank you for your willingness to assist. 

      Please see below my script and the items field is called "name". 

      {
      "style": {},
      "script": "",
      "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": "TextBlock",
      "size": "small",
      "weight": "regular",
      "wrap": true,
      "text": "Choose a Campaign",
      "style": {
      "color": "red",
      "padding-left": "10px",
      "margin-left": "10px",
      "backgroundColor": "red"
      }
      }
      ]
      },
      {
      "type": "Column",
      "spacing": "none",
      "width": "175px",
      "items": [
      {
      "type": "Container",
      "spacing": "none",
      "width": "150px",
      "items": [
      {
      "type": "Input.ChoiceSet",
      "id": "data.filters[0].filterJaql.members[0]",
      "class": "",
      "value": "Reseller",
      "displayType": "compact",
      "choices": "{choices:name}"
      }
      ]
      }
      ]
      },
      {
      "type": "Column",
      "spacing": "none",
      "width": "175px",
      "items": [
      {
      "type": "Container",
      "spacing": "none",
      "width": "80px",
      "items": [
      {
      "type": "ActionSet",
      "margin": "0px",
      "padding": "0px",
      "actions": [
      {
      "type": "Filters",
      "title": "Apply",
      "data": {
      "filters": [
      {
      "filterName": "{panel:name}",
      "filterJaql": {
      "explicit": true,
      "members": [
      ""
      ]
      }
      }
      ]
      }
      }
      ]
      }
      ]
      }
      ]
      }
      ]
      }
      ],
      "actions": []
      }
      • HamzaJ's avatar
        HamzaJ
        Data Integration

        Hi Sly 

        This is incorrect:

        "filterName": "{panel:name}",
         
        It should not be dynamic it should be the name of the filter. In this case it should just be "name":
        "filterName": "name",
         
        Make sure that on a dashboard-level the filter is defined the same way