---
title: "Creating Custom Action Groups"
canonical: "https://farmconnect.docs.rubiconwater.com/space/FCD/2038988916/Creating%20Custom%20Action%20Groups"
format: markdown
---
> Macro (toc)

> ℹ️ **Note**
> ℹ️ 
> ℹ️ This option is only available for MC-Edge gateways.

Use the **Program Action Groups** screen to create your own custom action groups. You can add these groups to your event-based programs by using the Advanced Program Interface when you are creating a program step. Use custom action groups to create reusable groups of commonly used actions and to simplify programs by grouping actions into a single step.

> ℹ️ **Examples:**
> ℹ️ 
> ℹ️ You might use program action groups to:
> ℹ️ 
> ℹ️ - Set the supply gate to irrigate over a specific time period.
> ℹ️ - Open all drains or close all gates prior to the start of the irrigation.

# Create a Custom Action Group

Creating an action group is very similar to creating a program using the Advanced Program Interface. You can use the built-in device actions and events but not the simple action groups (Irrigate Bay, Fill Channel, and Delay). The steps are:

1. Create the action group.
2. Add the actions and events.
3. Check the sequence of actions.

> ℹ️ **Example**
> ℹ️ 
> ℹ️ In this simple example program we will do the following:
> ℹ️ 
> ℹ️ - When the water level in Channel 1 reaches 500 mm we will open the bay gates for both Bays 1 and 2. Then we will close both gates after a delay of 60 minutes.

## Create the Action Group

**Step 1**

Hover over the **Irrigations** button from the Main Menu and choose *Program Action Groups* from the drop-down menu.

**Step 2**

Choose the **Create New Action Group** button :createActionGroup:  from the Irrigation Programs menu.

**Step 3**

Edit the action group name. We will call this group *Irrigate Bays 1 and 2*. Click Save to save your changes.

## Add Program Actions

Now we need to add events and actions to the group. 

- When the water level in the channel reaches 500 mm we will open the control gate on Bay 1. If the event times out, we will abort the action group so that none of the following actions in the group occur. If we can’t open the gate, we’ll continue with the program so we can still irrigate Bay 2.
- At the same time as we open Bay 1 we will open the control gate on Bay 2. If we can’t open the gate, we’ll continue with the program because we still need to irrigate Bay 1.
- Then we’ll close each gate after a delay of 60 minutes.

> ℹ️ **Note**
> ℹ️ 
> ℹ️ You can edit these actions and events when you add the action group to a program step.

**Step 1**

The first action opens the gate on Bay 1 when the level sensor reaches 500 mm.

**Step 2**

The second action opens the gate on Bay 2 as soon as the gate on Bay 1 opens. This will happen even if we couldn’t open the gate on Bay 1 because we set the previous action to *Continue without action.*

**Step 3**

The third action closes the gate on Bay 1 60 minutes after opening the same gate.

**Step 4**

The last action closes the gate on Bay 2 60 minutes after opening the same gate.

## Check the Action Group

Check the action group using the step list and the gantt chart. This is the step list:

![image](media://051698c8-b85f-4630-a0dc-661026940fa8)

1. *Open Bay 1 gate on water level reaching 500 mm*
2. *Open Bay 2 gate*
3. *Delay for 60 minutes on Bay 2*
4. *Delay for 60 minutes on Bay 1*
5. *Close Bay 1 gate*
6. *Close Bay 2 gate*
7. *Timeout allowance for Bay 1 closing*
8. *Timeout allowance for Bay 2 closing.*

*Check the step list*

# Use the Action Group in an Irrigation Program

To use this action group in a program we’ll create a new event-based program. 

- Make sure that you are using the **Advanced Program Interface** to add the first step.
- Under **Perform**, select *Stored Program Action Group*.
- Under **Execute action group** choose the group we just created - *Irrigate Bays 1 and 2*.

If we save this step we’ll only see one step in the Program Step list, but if we click the **Edit Program Action Group **button in the step settings we will see the same action list that we saw when we created the action group and we’ll be able to make any necessary changes to the actions.

---