string(3) "915"
Document Generator for Cloud Bitrix24
09.11.2017 15:11:00
Document Generator forms files with .docx-extention on the base of the template, created by the user, takes data from CRM.

Quick solution for the template question


Many Bitrix clients use the Business Process Designer in their daily work. Template business processes have made work much easier, but the formation of the same files manually after working out the business process still delayed the execution of the task. For example, such standard documents as a commercial offer or contract had to be filled manually with duplicate data — company names, employee names, requisites, etc.



It was necessary to develop a solution that allows to automate the formation of template files by substituting data from business processes. When creating a document, which contains, for example, company data, you have to fill in a lot of fields — name, details, etc. Doing this manually each time is long, and there is a high probability of making an error when copying data. Therefore, we needed a solution that allows you to transfer data directly from the CRM to the final file.



As result, we have developed a new activity for the Business Process Designer — "Document Generator", which generates a file with the extension .docx based on the template, created by the user, and sample data like details, names are automatically inserted into the template fields after launch of business process.


1. Choose the solution on the Marketplace.

2. Click Install, specify the path for installation.

3. After installation a new activity will appear in the Business Process Designer Document Generator.

Attention! If your tariff doesn’t have a Business Process Designer (Project and Project + tariffs), the solution will not be installed.

Price of this module: free.

Principle of operation (example)

To work with the Generator, you have to create a template file with the .docx extension. A template may contain any text with the formatting you need, and it has also contain fields of Merge Field type with given variable names for data substitution.

You can add fields of MergeField type this way: click the Insert tab, select Quick Parts - FieldSelect the «MergeField» type, enter the name of the variable in the «Field name» field, specify the field «Format» as «No».

Save the .docx template. Then you have to download it to the system. Go to the Drive menu, select the folder for the template, and load your template file there.

Attention! When working with MacOS it's desirable to use MS Word for Windows to create templates.



Note the ID field next to the loaded template. It will be used in the Generator settings. If the ID column is hidden, enable it in the settings.


Also create a folder to save the result file after running the Document Generator, and remember its ID.


After downloading the template, you can proceed to work with business processes. For example, we will create a template business process for the company in CRM.

At any point in the business process chain, add the Document Generator (from the Application Actions tab).


Open the Generator settings. In the settings are prescribed fields, from which data will be taken to be substituted into the variables of the template fields.

Let's look at the settings fields:


Title — the name of this activity. This is especially relevant if there are several of Generators in the chain of the business process. In this case, the created files with the result will have different names that you set in the settings of each activity; 

ID of the template (integer) — ID of the file with .docx extention, which was downloaded as a template file in the system; 

ID of the folder — ID of the folder to save the resulting file (integer); 

Name of file — format of the resulting file, foe example: KP_{=System:Date} — in this case, the name of the file will contain letters KP, underscore and the current date (if the file with this name already exists, the result will not be saved);

Label — name of the variable in the template file. If there are few fields of type Merge Field, click Add button and fill in the names of other variables; 

Text for label — the name of field, from which will be taken data for substitution. If you have markered few labels, for each you have to specify the “Text for label” field. You can choose the data field for substitution from the list - click on the button with three dots.

Run as - on behalf of which users run the business process. 

After filling all the fields of the Generator, click the "Save" button. Then, save the changes made to the business process (button below).

Starting a business process

After you have determined all the settings for the Generator, you have to start the business process, with which the file generation will be linked. In our example, the business process is performed on company data, so we select any company from the list and launch our business process for it.


After running the business process, the resulting file can be easily downloaded from the folder you specified in the settings, printed or sent by e-mail.


The resulting file completely saves the formatting you specified.




Significantly reduced the time of drawing up documents! Also, the human factor is excluded, since it is easy to make a mistake when filling out a multitude of similar documents. And when data is taken automatically from the system, it is excluded. M. C. Art knows how to make your work more effective!

Questions and answers
Question: How to display the ID of the created file, links to view and to download it?
Answer: Now the Document Generator for cloud Bitrix24 has a new possibility - to output the ID of the resulting file and links for viewing and downloading it. To do this, select the appropriate fields in the "Additional Results" section.

To use this new feature, reinstall the application.

To display the right values of this fields, in the settings of Generator specify "Set status message" - "Yes".

Question: Can I view the link to the saved file with the result?

Answer: Yes, now the Document Generator has output parameters "Link to view document" and "Link for downloading".

comments powered by Disqus