---
title: Rule groups
description: Create effective rule groups in your bot to manage complex eligibility criteria. Learn to build and apply rules for better decision-making.
---

[Skip to content](https://help.joseflegal.com/rule-groups#main-content)

<https://help.joseflegal.com/kb-tickets/new?hsLang=en>

[![Josef Logo](https://help.joseflegal.com/hs-fs/hubfs/josef-logo-4.png?width=120&height=40&name=josef-logo-4.png)](https://www.joseflegal.com)

Open main navigation

Close main navigation

- <https://help.joseflegal.com/kb-tickets/new>
- [Contact us](https://help.joseflegal.com/kb-tickets/new)

[Contact us](https://help.joseflegal.com/kb-tickets/new?hsLang=en)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Support](https://help.joseflegal.com/?hsLang=en)
2. [Josef No-Code Automation Platform](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en)
3. [Building bots](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#building-bots)

# Rule groups

<iframe height="315" src="https://www.youtube-nocookie.com/embed/4f3z2bDG2nU" style="margin:" 10px auto; display: block; clear: both; width="560" allowfullscreen></iframe>

\[**Video:** Short explainer on how to create rule groups. Once you've watched the video, [jump here](https://help.joseflegal.com/rule-groups#create-rule-group-example) for a quick recap\]

 

To build rule groups, you'll first need to know how to create [**connection rules**](https://help.joseflegal.com/connection-rules?hsLang=en) and apply the **[Any/All toggle](https://help.joseflegal.com/connection-rules?hsLang=en)**.

- [**What are rule groups**](https://help.joseflegal.com/rule-groups#rule-groups) 
    - [Example: Intake bot](https://help.joseflegal.com/rule-groups#rule-group-examples)
- [**Create a rule group**](https://help.joseflegal.com/rule-groups#create-rule-group) 
    - [Example: Sorting apples](https://help.joseflegal.com/rule-groups#create-rule-group-example)

### **What are rule groups?**

Like standalone rules, **rule groups** can be built in the **Edit connection** sidebar in either **Flowchart** or **List view**. 

However, unlike standalone rules, rule groups enable builders to isolate **sets of rules** much like how brackets group equations in algebra. This allows builders to apply multiple sets of rules that work either separately or in combination with one another.

#### **Example: Intake bot**

As an example of when you might build rule groups, let's take an intake bot that determines whether an end-user can receive legal help from a Legal Aid Organization. 

The Legal Aid Organization may not be able to help people if they are under 18 years old. However, if an end-user is severely disadvantaged, there may be an exception in the Organization’s mandate that states they must assist.

Once the bot has collected the user's age and eligibility, a message connection may feature the following rule groups:

- **Group 1:** If the person is over 18, we can help.
- **Group 2:** If the person is under 18 *and* severely disadvantaged, we can help.

The rule groups would look something like this.

![6886101839247](https://help.joseflegal.com/hs-fs/hubfs/Knowledge%20Base%20Import/6886101839247.png?width=291&height=291&name=6886101839247.png)

\[**Image**: Two rule groups applied to a single message connection with the Any/All toggle switched to Any\]

![6886132986767](https://help.joseflegal.com/hs-fs/hubfs/Knowledge%20Base%20Import/6886132986767.png?width=292&height=188&name=6886132986767.png)

\[**Image**: Group 1 containing a single rule where 2. Age \[is\] Over 18\]

![6886101846543](https://help.joseflegal.com/hs-fs/hubfs/Knowledge%20Base%20Import/6886101846543.png?width=291&height=265&name=6886101846543.png)

\[**Image**: Group 2 containing two rules where 2. Age \[is\] Over 18 AND 3 Social advantage \[is\] Severely disadvantaged\]

 

Here, the rule groups enable the bot to manage the conflict surrounding the end-user's age. They take both circumstances into consideration, whereas if the builder had just used standalone rules, this would not have been possible since the two eligibility criteria would have

1. Caused the bot to break, or
2. Led to all under 18s receiving unmandated help.

### **Create a rule group**

Here's how to create a rule group. 

1. In List view or Flowchart, select the relevant message connection and open the **Edit connection** sidebar.
2. Next to Add rule, click **Add group**.
3. By default, a rule group cell will be entitled **Group 1**. Click it.
4. The rule group tab will open. 
     - **Hint:** To rename the group, click **Group 1** at the top of the sidebar and input a new title.
5. Next, click **Add rule** and insert the relevant [**rules**](https://help.joseflegal.com/connection-rules?hsLang=en).  
     - [**Watch**](https://help.joseflegal.com/rule-groups#video) the walkthrough video to learn how.
6. Once applied, be sure to toggle the **Any/All toggle** correctly. This will determine how the rules within a group relate to one another.   
     - **[Learn more](https://help.joseflegal.com/connection-rules?hsLang=en)**.
7. To exit Group 1, click the left arrow in the top-left of the sidebar. This will take you back to the entirety of the connection's rules.
8. Like before, check the **Any/All toggle** applied to the **overall** rule equation is toggled correctly.  
     - Like #6, this will determine how all the individual rules and groups relate to one another. **[Learn more](https://help.joseflegal.com/connection-rules?hsLang=en)**.
9. Done!

#### **Example: Sorting apples**

In the video at the top of the article, we have a bot that utilises rule groups. Here's a quick recap of how the rule groups were implemented.

Responding to messages featuring **[single-choice text](https://help.joseflegal.com/response-types?hsLang=en)** response types, the user can choose from either Red or Green and Large or Small apples.

The end goal of this bot is to: 

1. **Discard** Small, Green apples because they’re unripe, and
2. **Keep** all Large and Small Red apples, as well as Large Green apples.

To achieve this, we apply the following rules to each connection.

 

**Message connection 1: Size to Keep**

**Aim:** keep ripe apples

*Any/All toggle =* ***Any***

- Color \[is\] Red
- Group 1 (Any/All toggle = **All**) 
    - Color \[is\] Green
    - Size \[is\] Large

**Note:** In Group 1, **all** rules need to be met but by switching the Any/All toggle to **Any** in the overall rules page, **either** Red or Group 1 can be true. 

 

**Message connection 2: Size to Discard**

**Aim:** discard unripe apples. 

*Any/All toggle =* ***All***

- Color \[is\] Green
- Size \[is\] Small

**Note:** Here **both** standalone rules need to be met, so we've switched the Any/All toggle to **All**. 

Together, these two message connections (containing rule groups) ensure only the right apples are kept and discarded.

 

\--

Got a question? Contact us at [support@joseflegal.com](mailto:support@joseflegal.com).

- [Josef Q](https://help.joseflegal.com/josef-q?hsLang=en#main-content)

    - [Using tools](https://help.joseflegal.com/josef-q?hsLang=en#using-tools)
    - [Training tools](https://help.joseflegal.com/josef-q?hsLang=en#training-tools)
    - [Preparing a knowledge base](https://help.joseflegal.com/josef-q?hsLang=en#preparing-a-knowledge-base)
    - [Release note (Josef Q)](https://help.joseflegal.com/josef-q?hsLang=en#release-note-josef-q)
    - [Creating tools](https://help.joseflegal.com/josef-q?hsLang=en#creating-tools)
    - [Managing tools and accounts](https://help.joseflegal.com/josef-q?hsLang=en#managing-tools-and-accounts)
    - [Integrations](https://help.joseflegal.com/josef-q?hsLang=en#integrations)
    - [Resources](https://help.joseflegal.com/josef-q?hsLang=en#resources)
    - [Monitoring & maintaining tools](https://help.joseflegal.com/josef-q?hsLang=en#monitoring-maintaining-tools)
- [Josef No-Code Automation Platform](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#main-content)

    - [Building bots](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#building-bots)
    - [Integrations](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#integrations)
    - [Notifications and workflows](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#notifications-and-workflows)
    - [Document creation](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#document-creation)
    - [Managing bots](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#managing-bots)
    - [Testing, troubleshooting and editing](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#testing-troubleshooting-and-editing)
    - [Launching](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#launching)
    - [Single Sign-On](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#single-sign-on)
    - [FAQs](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#faqs)
    - [Getting started on Josef no-code](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#getting-started-on-josef-no-code)
    - [Release notes & FAQs for Josef no-code](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#release-notes-faqs-for-josef-no-code)
    - [Managing accounts](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#managing-accounts)
    - [Reporting](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#reporting)
    - [Formatting a bot](https://help.joseflegal.com/josef-no-code-automation-platform?hsLang=en#formatting-a-bot)

[![Chill listening crop-3](https://help.joseflegal.com/hs-fs/hubfs/Josef%20logo.png?width=72&height=24&name=Josef%20logo.png "Chill listening crop-3")](http://joseflegal.com)

[support@joseflegal.com](mailto:support@joseflegal.com) 

<https://twitter.com/joseflegal/> <https://www.linkedin.com/company/joseflegal/> [mailto:support@joseflegal.com](mailto:support@joseflegal.com)

Copyright © 2025, Josef Legal