How to hide a field on a search component?

I kindly request your help, as I’m not being able to make it work with JS.
Basically I want to hide some fields on a search component given the content on a profile field.
Logic is clear, but what I can’t get is the “simple” task of hidding the field, not the conditional logic.
e.g. I have a search component to select profiles that match some conditions.


Considering user preselection, he just want to see the option English & French, so we have to hide Spanish & German.

If I set CSS class on each one “lang-sp”, “lang-en”, “lang-fr” and “lang-de” then hidding the class, I think it should work

$(‘. lang-sp’).hide(); // to hide spanish field, But it doesn’t work,

Added search component class:
$(‘.logistics .lang-sp’).hide(); // with same negative result

Also tried using element:
document.getElementById(“field_222”).hide() // with negative result.

For sure I’m using wrong approach, and also I’ doing my best to learn JS.
Your help is pretty much appreciated

I see “no code” is becoming “low code”, and I’m getting used to it while learning new abilities. :slight_smile:


Why not add a ‘hidden’ column with some kind of formula? That the output is only shown when some conditions are met, and otherwise it’s blank…
And filter the data table from the search component only with fields which contain values (not leave out the blanks)

Well, it’s not the output fields (search result) that I’m trying to hide, but the fields used to search on the search component. Idea is to show only the relevant fields, instead of all. If user select French, only French field (among others) will be shown. No need to show 4 fields, when user is interested in one. It’s just to show a clear serach component, not crowded with several not relevant fields. So the key is how to hide a field on a search component. The rest is just logics. :slight_smile: Thanks for your hint anyway.