Forum Discussion

PelaezLink's avatar
PelaezLink
Helper I
4 years ago
Solved

What to change on Text Filter visual source code to use exact match search instead of contains.

Hello guys. 

 

So I found that the source code for the Text Filter Visual is avalible on:

 

https://github.com/microsoft/PowerBI-visuals-TextFilter

 

I am currently using the filter but the search uses a "Contains" search, meaning that it will search for any appearence of certain characters. I need to have this same visual but with an exact match search, so I only get results for the exact characters I typed. So I download the source code and changed the code to make it work this way. The only thing I saw that would work is on src/visual.ts on line 191, change operator "Contains" for "Is". Then I packaged the visual and exported it to Power BI desktop but is working in the same way as the normal Text Filter, is not using an exact match search, I did not changed anything else in the source code. I don't know if it is because it has already saved the data for the normal visual or what. In any case I was wondering if any of you would know what should I change in the source code in order to make it work as intended.

 

Also if you know any other way to have something like the Text Filter visual but with exact match it would be great.

 

Thanks a lot.

Luis.

  • Hi PelaezLink,

    If that's all you've changed, then when you package and load the visual, Power BI will recognise that the visual's GUID matches the one already in AppSource and will load that one from there. This is a way of ensuring that AppSource visuals always stay current and creators don't have to manually update them.

    You will also need to change the guid property in pbiviz.json  to something unique - you could add a number to the end, or prefix it with 'PalaezLink' or whatever; just enough to make it a guid that is not already registered in AppSource.

    Note that by doing this, this visual will no longer be certified as it's no longer tied to the version in AppSource. If you need it to be certified, you will need to publish your visual to AppSource yourself and go through the certification process. You can read about this here.

    With this 'uncoupled' version working, you'll get some bonus formatting changes that I submitted a couple of years ago. These have been approved by MS, but I don't think that they are planning to update the published version with anything new, so you may at least find them useful.

    Good luck!

    Daniel

3 Replies

  • dm-p's avatar
    dm-p
    Super User

    Hi PelaezLink,

    If that's all you've changed, then when you package and load the visual, Power BI will recognise that the visual's GUID matches the one already in AppSource and will load that one from there. This is a way of ensuring that AppSource visuals always stay current and creators don't have to manually update them.

    You will also need to change the guid property in pbiviz.json  to something unique - you could add a number to the end, or prefix it with 'PalaezLink' or whatever; just enough to make it a guid that is not already registered in AppSource.

    Note that by doing this, this visual will no longer be certified as it's no longer tied to the version in AppSource. If you need it to be certified, you will need to publish your visual to AppSource yourself and go through the certification process. You can read about this here.

    With this 'uncoupled' version working, you'll get some bonus formatting changes that I submitted a couple of years ago. These have been approved by MS, but I don't think that they are planning to update the published version with anything new, so you may at least find them useful.

    Good luck!

    Daniel

  • Guirikiki's avatar
    Guirikiki
    Frequent Visitor

    Hello,

     

    Is it possible to share the adapted visual file? In order to take into account the exact search.

     

    Or is there a method to easily recompile modified code into a visual file?

     

    Thanks a lot!

    Guillaume