Filter based on transformer

The filter labelled ‘Filter based on transformer’ looks so promising, but how do I use it? What do the fields in its configuration mean and what input will the transformer get, and what kind of output should it produce?

Could this be documented?

Hi, Harry Vennik.

We’re sorry to make you wait.
The good news is we’re now creating the article for the “filter-based transformer”
We will back to you once it has been released.

Many Thanks

Best Regards

Lathif

Hi, Harry Vennik.

We would like to inform you.
Our Documentation is in progress and will probably published at the start of January due to the holiday session. We appreciate your patience.

Thank you so much

Best Regard

Lathif

Hi, Harry Vennik.

We would like to inform you of the good news.
Our documentation has been published.

Please have a look at this link:

Thank you and have a nice day!

Best Regard

Lathif

1 Like

Thanks for publishing the documentation. Unfortunately, a few things remain unclear. I still don’t quite get the part about the comparator. How to specify which values to compare? Looks like the ‘Search pattern’ setting is relevant here, but I’d expect a comparator to require (at least) two inputs. So where is the second?

Hi, Harry Vennik.

Regarding the comparator, to answer your question we have created an example of the configuration.
In this example, we are going to check whether the specific date expired or not
based on a date comparison.

  • Select settings → Data, transform data using mappers and conditions → Conditional transformer → And then put “filter based on transformer” in it as the “if” part.

  • Select data transformer → value setter → fill in the fields in the configurations as the example below:
    - Key = today
    - Value = string leave field on the right side empty
    - Mappers = Format:Date
    - Output = Y-m-d

  • Select comparator → Pick “Greater than” → fill in the “Search pattern” as the first input. The “Search pattern” must be based on the configuration key which was previously filled in as “today” → Fill in the “entity path” as the second one - let’s say “expired_date” → Make sure the “Use entity data in transformer” checked.
    This way we apply a logic

     if(today > expired_date) // if search pattern greater than entity path
    

  • Configure the “then” part in the “Then apply transformer” → select value setter → fill in the key as let’s say “is_expired” → set the value as a boolean cause we need to store the date comparison result.

  • Last but not least we set the apply transformer to see the result “is_expired”

To test the transformer we give this object as an input:

{
  "expired_date": "2024-10-01"
}

Here is the result:
result

we have attached the configuration example as well

filter-based-transformer-comparing-the-date_transformer.ndjson (921 Bytes)

Hope that helps!
Thanks a lot

1 Like