The Process file process element lets you automate file operations in business processes (Fig. 1).
The Process file element lets you:
- Read and copy files from the Attachments details of Creatio records.
- Get files from process parameters.
- Generate Word and Fast Report reports.
There are several ways to take advantage of the read or generated files:
- Use them during the business process runtime. For example, send the files as email attachments.
- Save them to the Attachments detail of other records (Fig. 2).
Process files in a business process
Example setup for object files
Set up the Process file element the following way (Fig. 3).
- What is the source of the file? – select “Attachments and notes of the object” to let the element read the files on the Attachments detail.
- Which object to receive file from? – select a Creatio object that contains the relevant files. In this case the relevant object is “Contact attachment”.
- How to filter records? – set the necessary filters and specify the number of records to read. In this case, select the attachments of James Smith and specify 10 records. This way, the element will use the first 10 records that correspond to the sorting order (see below). Read more about working with filters in the Filters article.
- How to sort records? – specify the sorting order. For example, changing the sorting order helps if there is a large number of documents in the Attachments detail yet only the most recent documents are relevant. In this case, sort the records by creation date in descending order.
- What to do with file? – select one of the following options:
- “Use in process” if you need to use the file records in the process itself without saving the files to any Creatio object or if you need to to pass the files to a different business process as a parameter.
- “Save to “Attachments and notes” of the object” if you need to save the files to the Attachments detail of a particular object. You can also use the file collection in the process itself or pass these files to another business process as a parameter.
In this case, select “Save to “Attachments and notes” of the object”.
- What object to save file to? displays if you select “Save to “Attachments and notes” of the object” in the previous step. Specify the Attachments detail of the Creatio object that will contain the copied files. In this case you need to copy the files from a Creatio contact to a different contact's detail, therefore select “Contact attachment”.
A new field connected to the selected object will appear. Specify the record that will store the saved files in this field. In this case, the Attachments detail is connected to the “Contact” object. Use parameters or values to fill out this field. For example, click “Lookup value”, specify the relevant contact from the list, and click Select.
That way the element will copy the first 10 files selected based on the sorting order from the Attachments detail of the contact (e.g., James Smith) and save the files to the Attachments detail of another contact (e.g., Valerie E. Murphy) during a business process.
Example setup for process parameter files
To do this, set up the Process file element as displayed on Fig. 4.
- What is the source of the file? – select “Process parameter” to enable the element to read process parameters of the “File” type.
- Files – specify the process parameter that contains the relevant file. You can specify a single file or a collection. Click the button next to the field and select:
- “Process parameter” to select the parameter whose value you want to pass.
- “Formula” to set up file generation conditions based on the process parameters.
-
What object to save file to? – specify the Attachments detail of a Creatio object to store the copied files. Since this example requires copying the file to the current contact’s detail, select the “Contact attachment” value.
Depending on the specified object, a new field may appear. Use this field to specify the record to store the saved files. For this example, the Attachments detail is connected to the “Contact” object. Use parameters or values to fill out this field. For example, select “Current user contact.”
As a result, Creatio will save the file retrieved from the process parameter to the current user’s Attachments detail.
Generate reports in a business process
This functionality is available for Creatio version 7.17.2 and up.
Set up the Process file element the following way (Fig. 5).
- What is the source of the file? – select “Generated report” to let the element generate a report during the process itself.
- What report to generate? – select an available report from the dropdown. In this case, select “Order”.
You can generate Word or Fast Report reports. Fast Report lets you generate a report for each record. Activate this option by checking the Generate separate report for each record box. By default, Fast Report generates a single report with all the data of the filtered records.
Word always generates individual reports for each record. Learn more about generating reports in the Print-ready reports section. - Section – displays the section used as a report source. This is a non-editable field.
- How to filter records? – set the necessary filters. In this case, filter orders issued in specific currencies: Euro or US Dollar. Read more about working with filters in the Filters article.
- File name – set a custom report file name pattern. Use parameters or values to fill out this field. For example, click “Column from this selection” → “Number” to set the file name pattern based on the order number.
- File name – set a custom report file name pattern. The file name will consist of the report’s name and the value specified in this parameter. For example, select Column from this selection → Number to make the name of the generated file look like this: “Order. ORD-30.”
- What to do with file? – select one of the following options:
- “Use in process” if you need to use the file records in the process itself without saving the files to any Creatio object or if you need to to pass the files to a different business process as a parameter.
- “Save to “Attachments and notes” of the object” if you need to save the files to the Attachments detail of a particular object. You can also use the file collection in the process itself or pass these files to another business process as a parameter.
In this case, select “Save to “Attachments and notes” of the object”. - What object to save file to? displays if you select “Save to “Attachments and notes” of the object” in the previous step. Specify the Attachments detail of the Creatio object that will contain the copied files. In this case you need to save the generated report to the partnership record, therefore select “Partnership attachment”.
A new field connected to the selected object will appear. Specify the record that will store the saved files in this field. In this case, the Attachments detail is connected to the “Partnership” object. Use parameters or values to fill out this field. For example, click “Lookup value”, specify the relevant partnership from the list, and click Select.
That way the element will generate a set of reports for all the filtered records of the Orders section during a business process. Creatio will save the reports to the Attachments detail of the partnership (for instance, ClearSoft Systems).