Later on, in my code I have to use all rows where the value âToyota Etios VXDâ is found.
How can I request for the expression above analyze, for example, a +1 row (btw, theyâre usually together, one after the other, but would like to handle it if they were not, just in case).
So, something like the following pseudocode, pardon me if isnât clear, feel free to ask:
if(contains(column("vehicle"),variable("Toyota Etios VXD")) == true) {
ALLROWS FROM column("vehicle") WHERE VALUE MATCHES variable("Toyota Etios VXD"))
} else {
(" ")
}
where the result would return me both of these rows:
Hello @jarviscampbell
I think weâve been dealing with a few wildcard filtering requests, in the latest days. Not by using Column Expressions node but regex match. We solved your latest topic in a similar way
You can have a look to the following topic (2 days ago) in forum for insights; as I think is very similar problem, but in your case using a complete row instead of a âdescriptionâ
However in the example you show; Why not to use a standard Row Filter?
You may not need to complicate your workflow with logical indexing either. By filtering $vehicle$ == âToyota Etios VXDâ you can achieve the desired output.
Hi @jarviscampbell , @gonhaddock has already answered your question and I would do the same, which is using the Row Filter.
In addition, I wanted to clarify something for you. This:
if (contains(column("vehicle"),variable("Toyota Etios VXD")) == true) {
column("vehicle")
}
The above expression will be applied to all the rows of column âvehicleâ, not just 1 row. So from your sample data, both lines 2 and 3 will be true. You do not need to do a+1 row
I understand that, however, when this expression only picks up the first occurrence of the variable. It does not return me âallâ occurrences, and thatâs what I am after. Thanks!
Hi @jarviscampbell , if that is the case, then it could be that your data might have some hidden characters or have space before or after the value, which you canât see with the eyes.
One trick to test this is to do something like via String Manipulation: join("XXX", $vehicle$, "XXX")
This will show you if there are any spaces before or after the values in your vehicle column.
Also, what is in your variable âToyota Etios VXDâ?
if (contains(column("vehicle"),variable("cars")) == true) {
column("vehicle")
}
I have a âSingle Selection Configurationâ Node with a few selection of cars. One of them is the âToyota Etios VXDâ, so when I select it, it becomes a âvariableâ value. Sorry about the confusion. I was able to figure it out and make it work with the âFind Keywordâ workflow.