Articles in this section

Create or explain filter rules using Celigo AI

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.

Note

Celigo Ora must be enabled in your integrator.io account. Click the avatar icon in the upper right corner of integrator.io and click Profile.

To provide a more natural and intuitive experience, Celigo Ora for filter rules allows you to engage naturally and conversationally. Instead of relying on a rigid and command-based approach, the AI assistant will allow you to ask dynamic follow-up prompts with guided responses.

To maintain the defined scope, if your prompt/query falls outside the assistant’s capabilities, Ora will display an error message or guide you with relevant information.

Create filter rules from simple language prompts

To create a filter, enter a valid prompt in Celigo Ora. After the results of your initial prompt are retrieved, you can enter additional prompts that describe additional changes to the expression that Ora might not have fully understood. All previously provided prompts will be saved and can be viewed or copied. 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 Ora 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

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

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

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

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.

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.

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".

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.

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.