Articles in this section

Create or explain filter rules using the Celigo AI component

For users with minimal programming experience, Celigo AI simplifies creating and explaining filter rules for input or output filters. Define the use case in a plain English prompt, and Celigo AI will generate the filter rules without requiring you to create them manually. You can describe filter rules that include multiple fields and complex use cases.

Important

23502889716891-0c20e9c0-a2d2-4cc2-8195-4b7deca77533
Celigo AI must be enabled in your integrator.io account. Click the avatar icon in the upper right corner of integrator.io and click Profile.

Note

An error displays if your Celigo AI prompt is empty or invalid

Create filter rules from simple language prompts

To create a filter, enter a valid prompt in the Celigo AI section. After the results of your initial prompt are retrieved, you can enter additional prompts that describe additional changes to the expression that Celigo AI might not have fully understood. All previously provided prompts will be saved and can be viewed or copied until you click Reset conversation or close the editor window. The editor also provides sample text to inform your use of the text prompt field.

Click thumbs up or thumbs down for each prompt to indicate if the response provided by Celigo AI was helpful or unhelpful.

Example 1: A simple example with two prompts

Sample JSON

Prompt

Filter Rule

  {
    "record": {
      "name": "John",
      "age": 30
    }
}

Only process where name is John and age is greater than 21

23502889721115-bb6cd204-c423-4944-a89e-55594693ef46
23502882133403-e09df008-a9ea-47ca-ac95-d81bfa0cc5b0

Example 2: A prompt with complex query and grouping operation

Sample JSON

Prompt

Filter Rule

  {
    "record": {
      "id": 1,
      "title": "iPhone 9",
      "description": "An apple 
mobile which is nothing 
like apple",
      "price": 549,
      "discountPercentage": 12.96,
      "rating": 4.69,
      "stock": 94,
      "brand": "Apple",
      "category": "smartphones"
    },
    "settings": {
      "integration": {},
      "flow": {},
      "flowGrouping": {},
      "connection": {},
      "iClient": {},
      "export": {}
    }
}

"filter based on following conditions 1. samsung brand, 3.9 rating, smartphones category or 2. apple brand, 4 rating, wearables category"

23502889730203-4e3f121d-97cd-4849-9121-aa380f563922
23502882141083-b105c61d-1dca-4b9c-a9bf-bd75c944181f

Example 3: A complex prompt with numbers

Sample JSON

Prompt

Filter Rule

 {
    "record": {
      "listingId": 8391,
      "make": "Tesla",
      "model": "Model Y",
      "year": 2022,
      "price": 49999,
      "mileage": 5000,
      "color": "Midnight 
Silver Metallic",
      "interior": "Black",
      "battery": "Long Range",
      "range": 326,
      "status": "available",
      "location": {
        "city": "Los Angeles",
        "state": "CA"
      }

filter based on below conditions 1. made by either Tesla or Toyota 2. year should be between 2020 and 2022 3. status is available 4 price is less than 60000

23502889735579-b9dccc8c-2b86-4298-963a-7fb75b963940
23502889739931-ba14f916-61ad-4ff0-a9cd-8173cf55a421

Example 4: An example to create filter rules for settings

Sample JSON

Prompt

Filter Rule

{
  "record": {
    "product": "Laptop",
    "brand": "Dell",
    "model": "XPS 15",
    "price": 1200,
    "inStock": true
  },
  "settings": {
    "integration": {
      "name": "sales"
    },
    "flow": {
      "environment": "sandbox"
    },
    "flowGrouping": {},
    "connection": {},
    "iClient": {},
    "export": {}
  }
}

filter by following rules i. should be in stock item i. integration name is "sales" iii. environment is "sandbox"

23502889742875-39409a67-002c-4078-a0f2-a5a450f968bd
23502882159259-d973f8fa-3162-4fb1-97ef-3b6d282f2fda

Explain filter rules in simple language

Celigo AI explains the filter options for the rules configured. Click Explain filter rules to generate a detailed explanation for the filter rule. You can reposition the explanation window as needed.

Note

When explaining filter rules, if the rule includes a negative operation and you select "not equal" in the Rules editor, Celigo AI may not generate accurate results.

23502889751195-b525dcc4-5094-4bc6-b3eb-1de69ab56ff2

Example 1: A simple example with two prompts

Sample JSON

Prompt

Explanation

{
    "record": {
      "name": "John",
      "age": 30
    }
}

Only process where name is John and age is greater than 21

The filter rule is an "and" condition, meaning both conditions must be true for the filter to pass.

- The first condition checks if the name extracted from the data is equal to "John".

- The second condition checks if the age extracted from the data is greater than 21.

23502889757211-2b8a2252-abff-4142-ac5f-782d7973758f

Example 2: A prompt with complex query and grouping operation

Sample JSON

Prompt

Explanation

 {
    "record": {
      "id": 1,
      "title": "iPhone 9",
      "description": "An apple 
mobile which is nothing 
like apple",
      "price": 549,
      "discountPercentage": 12.96,
      "rating": 4.69,
      "stock": 94,
      "brand": "Apple",
      "category": "smartphones"
    },
    "settings": {
      "integration": {},
      "flow": {},
      "flowGrouping": {},
      "connection": {},
      "iClient": {},
      "export": {}
  }
}

"filter based on following conditions 1. samsung brand, 3.9 rating, smartphones category or 2. apple brand, 4 rating, wearables category"

The filter rules can be explained as follows:

1. If the brand is "samsung" and the rating is 3.9 and the category is "smartphones", OR

2. If the brand is "apple" and the rating is 4 and the category is "wearables".

23502882167451-d6269903-6ec7-41e1-a4ac-75af159f9be8

Example 3: A complex prompt with numbers

Sample JSON

Prompt

Explanation

 {
    "record": {
      "listingId": 8391,
      "make": "Tesla",
      "model": "Model Y",
      "year": 2022,
      "price": 49999,
      "mileage": 5000,
      "color": "Midnight 
Silver Metallic",
      "interior": "Black",
      "battery": "Long Range",
      "range": 326,
      "status": "available",
      "location": {
        "city": "Los Angeles",
        "state": "CA"
      
}

filter based on below conditions 1. made by either Tesla or Toyota 2. year should be between 2020 and 2022 3. status is available 4 price is less than 60000

The filter rule can be explained as follows:

- The rule contains multiple conditions that are connected using the "and" operator.

- The first condition is an "or" condition, which means either of the following conditions can be true:

- The value of the "make" field is equal to "Tesla".

- The value of the "make" field is equal to "Toyota".

- The second condition is that the value of the "year" field is greater than or equal to 2020.

- The third condition is that the value of the "year" field is less than or equal to 2022.

- The fourth condition is that the value of the "status" field is equal to "available".

- The fifth condition is that the value of the "price" field is less than 60000.

23502889767451-d42d1716-808b-4d99-9ce1-63bebae5d765

Example 4: An example to create filter rules for settings

Sample JSON

Prompt

Explanation

 {
  "record": {
    "product": "Laptop",
    "brand": "Dell",
    "model": "XPS 15",
    "price": 1200,
    "inStock": true
  },
  "settings": {
    "integration": {
      "name": "sales"
    },
    "flow": {
      "environment": "sandbox"
    },
    "flowGrouping": {},
    "connection": {},
    "iClient": {},
    "export": {}
  }
}

filter by following rules i. should be in stock item i. integration name is "sales" iii. environment is "sandbox"

The filter rule is an "and" condition, meaning all the conditions must be true for the filter to pass.

Explanation of each condition:

1. Check if the value of the field "inStock" is equal to true.

2. Check if the value of the field "integration.name" is equal to "sales".

3. Check if the value of the field "integration.flow.environment" is equal to "sandbox".

All three conditions must be true for the filter to pass.

23502882179995-8d064c42-2f27-43f0-83cd-40f65612cf6c
Was this article helpful?
0 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.