# Actions Moy Klass

Actions allows the bot to read current CRM data Moy Klass and perform client-confirmed operations. First, [**connect integration**](<../../integrations/CRM/moy-klass.md>).

## How to add an action

1. Open **My Bots** and press **Change** for the desired bot.
2. Go to **Integrations and actions**.
3. Enable **Enable actions in the bot**.
4. Press **Add action**.
5. In **What to do as a result of** click **Add action**.
6. In **Actions in integrations** select the source **Moy Klass**.
7. Select the desired operation and adjust the parameters.

## Available action

### Get staff.

Returns employees from Moy Klass. Enable **Filter employees** if the bot only has to work with selected employees.

### Get programs

Returns the curriculum. The **filter according to the** program allows you to limit the issuance to pre-selected directions.

### Get groups

Returns groups and related information. Filters are available:

- by group;
- on the program;
- branch.

Use this action when a client asks about suitable groups, cost, schedule, teacher or availability of places.

### Get classes

Returns classes. The list may be limited to:

- occupation;
- group;
- employee;
- student;
- branch.

First identify a group or student, then request classes, so the bot will get a more accurate result.

### Find/Create a Student

Looks for an existing student and creates a new card if necessary.

To search, you can use the student from the list, name, phone or email. If search is enabled, select at least one criterion. The phone must contain no more than 15 characters.

To create a student, turn on **When unsuccessful search to create a student**. In the creation block are available:

- **FIO** - mandatory field, no more than 100 characters;
- telephone – no more than 15 characters;
- email – no more than 100 characters;
- parent – no more than 100 characters;
- client status;
- branches;
- responsible officers.

!!!warning
Secure sequence: first get a name and a full phone, then search by phone and only if there is no result create a student. Do not create a card without a phone and do not show the client an internal ID.
!!!

### Enroll a student in a group

Creates a student entry in the selected group.

Mandatory parameters:

- **Student**;
- **Group**;
- **Record status**.

In addition, you can specify the program, responsible employee, price and comment. The price can not be negative, the comment - no more than 1000 characters.

Before recording, confirm with the client the selected group and conditions. The student ID is conveniently obtained by the action **Find/Create the student**.

### Get group records

Returns existing student records to groups. Filters are available:

- branch;
- group;
- staff member
- pupil
- program;
- record status.

### Get the job done

Returns tasks from CRM. They can be filtered by branch, group, employee, student and execution status. The default status is **Not executed**.

### Set the task

Creates a task for an employee in Moy Klass.

Mandatory parameters:

- **Text of the problem** - no more than 250 characters;
- **The beginning of the task** - date and time;
- **The end of the task** is the date and time.

In addition, the task can be associated with responsible employees, students, groups and branches.

## Recommended sequences

### Scheduled consultation

1. **Receive programs**.
2. **Get groups** for the selected program or branch.
3. **Get classes** for the selected group.
4. Respond to the client only with data obtained from Moy Klass or knowledge base.

### New application

1. Get the client's name and phone number.
2. **Find/Create a student** - first search by phone.
3. Confirm program and group.
4. **Enroll the student in the group**.
5. **Set the task** to the responsible employee.
6. Transmit the dialogue to the employee, if it is provided by the bot scenario.

### Verification of the existing record

1. Find a student on the phone.
2. Call **Receive entries in groups** with a filter for the student.
3. If necessary, receive related classes or tasks.

## Setting up the prompt

In the main purpose and description of the action clearly indicate:

- When a bot can create a student or record
- What data should be collected before the call;
- that the customer must confirm;
- What to do if the search returned several results or nothing
- Internal ID and technical data cannot be shown to the customer.

Transmit the fields from the conversation through the variables `@`. Before publishing, check the script in **Testing** and make sure new data appears in Moy Klass without duplicates.
