Search Bar using Blox

Comments

12 comments

  • Avatar
    Ron Oren (Edited )

    Sure, please use this sample template and see the structured. 

    We used the JQAL query in BloX filter actions and connected it to dashboard filters using the Panel filters action ( in this case we used BRAND from the sample e-commerce cube)

    you can also use the Filter Name to apply on dashboard filters instead or the Panel filters.

     

     

     

     

     

     

    1
    Comment actions Permalink
  • Avatar
    Connor B

    Thank you. However when I run this, it says "this specified card version is not supported." How can I work around this?

    0
    Comment actions Permalink
  • Avatar
    Ron Oren

    Hi Connor, 

    Which version of BloX are you using?

    This message usually appears when using the old version, meaning all the new functions and actions ( filter is one of them) will not be supported.

    Please make sure to download the latest from here and re-check.

     

    Thanks,

    Ron

    0
    Comment actions Permalink
  • Avatar
    Gaurav Tapaswi

    Hi Ron,

    I am also looking for same kind of functionality. However, tried the code which you have mentioned but not sure what we need to write in actions. What value should we pass in "contains"?

     "actions": [
                {
                    "type": "Filters",
                    "title": "Search",
                    "data": {
                        "filters": [
                            {
                                "panelName": "Brand",
                                "jaql": {
                                    "contains": ""
                                }
                            }
                        ]
                    }
                }
            ]
        }

    I am looking for functionality like whatever we enter in search box that should act as a filter when we click on search button. I am using Sisense Blox version 2. 

    Could you please provide some solution? If you have any other or newer code for this, could you please share the same?

    0
    Comment actions Permalink
  • Avatar
    Adi Lewenstein (Edited )

    Hi Gaurav,

    The contains property will automatically be populated with the text input's value.

    When an input element is assigned an id, its value is automatically injected into the action's data property under the path dictated by the id.

    In the attached template's example, the input's id directs the value into the contains attribute, thus completing the JAQL's search term

    {
                            "type": "Input.Text",
                            "width": "60%",
                            "horizontalAlignment": "center",
                            "id": "filters[0].jaql.contains",
                            "placeholder": "placeholder",
                            "defaultValue": "",
                            "borderRadius": "4px",
                            "borderStyle": "none",
                            "backgroundColor": "#F4F4F8"
                        }

    Let me know if it makes sense.

     

    Thanks,

    Adi

    0
    Comment actions Permalink
  • Avatar
    Gaurav Tapaswi

    Hi Adi,

    Thank you for your response.

    However, in my case this not working as you mentioned. When we enter any value in search box and click on search button then filter values shows "filtered with custom filter" message and inside the filter value is blank.

    Please find below screenshot for reference. 

     

    I have used the exact same code which is there in the link. https://s3.amazonaws.com/sisenseblox/Community+Materials/BloX+Templates/Search+Bar.json 

    Please let me know if I missed out something.

    Thanks!

    1
    Comment actions Permalink
  • Avatar
    Adi Lewenstein (Edited )

    Hi Grurav,

     

    I checked again and it seems that we sent a version with an old syntax.

    Can you try updating both jaql attributes to filterJaql?

    In the input's id:

    "id": "data.filters[0].filterJaql.contains",
     
    and in the action structure:
    {
    "type": "Filters",
    "title": "Search",
    "data": {
    "filters": [
    {
    "panelName": "Brand",
    "filterJaql": {
    "contains": ""
    }
    }
    ]

    }

    }
    3
    Comment actions Permalink
  • Avatar
    Gaurav Tapaswi

    Hi Adi,

    Thank you for your quick response.

    I have updated the script and it works like a charm :)

    Thank you very much again for your help.

     

    Thanks 

    Gaurav

     

    0
    Comment actions Permalink
  • Avatar
    Antti Wolk

    Could you please provide the templade code in a different way.
    I am too stupid to copy paste it into Blox.


    0
    Comment actions Permalink
  • Avatar
    Adi Lewenstein

    Hi All,

    The full fixed template is available here.

    1
    Comment actions Permalink
  • Avatar
    Antti Wolk

    Hi Adi,
    thank you very much.
    Is there also a description available, how to use it?
    I would need to know at what position I need to change the code with my variables.

    I copied the code to my editor but I can't see anything.

    Thanks for your patience :-)

     

     

     

     

     

    0
    Comment actions Permalink
  • Avatar
    Davy Burger

    Hi All,

    Is there anyone who knows or maybe already created the search bar for multiple rows. I managed to create two search fields in the filter bar, however on of them remains empty when executing the search. 

    Furthermore, I was looking into an autocomplete functionality for the search bar. Is this possible, considering JSON being the only supported format? Any ideas?

    Thanks in advance!

    0
    Comment actions Permalink

Please sign in to leave a comment.