Transformer used for Filtering and Sorting Data Based on the Value Conditions

You can use a transformer to filter and sort data based on some values and checks. For example, you can filter out data that doesn't meet the criteria, or select the entities that are greater or less than or equals some value.

Goal: We want to check if the id of an entity equals 10.

Initial data:

In public API accessed here: https://jsonplaceholder.typicode.com/posts?userid 

 

Add a new transformer: 

Settings: Data, transform data using mappers and conditions 

Filters: value condition

Accessor: key accessor 

Keys: id 

Check if id equals value 10 

Conditions:  Equals

Value*: number  10 

 

Another check if the name of the company equals specific name.

Filters: value condition

Accessor: Pattern accessor 

Pattern: company.name

 

Conditions: Equals 

Value* : string Foobar

(will be an empty result)

 

If you put 

Conditions: Equals 

Value* : string  Abernathy Group

The object with id 10 will be selected and filtered since it matches the value of the key “name” in company.name pattern.

 

Another example: 

We want to check if the id is 9<id<11

Conditions: Logic: And 

Conditions: Number: greater than 

Value*: 9

Conditions: Number: less than 

Value*: 11