File processing

This functionality allows you to extract text from a file that the client sent in a dialog.

What's it for?

  • The client can send files in docx, pdf, rtf, txt or any other format;

  • The bot will be able to process the file, or pass the result from the file to other action steps.

Creating an action to extract text from a file

1

Go to the “Workflows” section and click the “Create” button

2

Go to Workflows Settings

Name of action

Display name, by which you can easily identify the desired action in the general list.

Function name

Must describe the main meaning of the action. Only English characters and underscores are allowed (_)

Function description

A description of what the action will do

Error message

What text will be returned to the bot when an error occurs. We recommend to put something like “An error occurred” in it

Rules for replying to a bot

Several webhooks can be called or other functions can be performed within one action.

With this setting, we have the ability to choose whether the response from the first step, the last step, or all steps will be passed to the bot.

3

Fill in the blanks:

To automatically generate a Function Name, fill in the Action Name field and click the auto-generate button to the right of the Function Name field.

4

Add an Action Argument by clicking the plus sign in the box below

5

Fill in the fields in the “Action Arguments” section

Argument - since the argument for the function is any document, we write file in the Argument field file

Argument description - this field is optional and serves as a description to avoid confusion if there are several arguments.

Type - since this step supports only arguments-files, choose “Document”.

6

Add a step by clicking on the “Add Step” button

7

Select the type of step

8

In the menu for setting the step from the drop-down menu, select the “file” argument. Click “Save”.

Name - filled in automatically when selecting the step type.

Argument in which the file will be transferred - select the appropriate argument from the drop-down menu.

Put the received text into a variable - allows you to pass the received text to other steps.

Scanned text reading mode - allows you to use the so-called “Smart reading of files and pictures”. If the action sent a scan in pdf (not text) or word with pictures, this mode will be able to read these files as text. Price - 0.5 rubles per page.

9

Click on the “Save” button to save the action.

10

Setup is complete.

Last updated