The Process File process element allows you to do things such as generate a printable in a Creatio process. The printable to use for the Process File is something that you must select at the time when you’re designing the process. This property does not allow you to select a process parameter to use for the template.
I had a business need to select a printable template type that could vary based on the record type. To accomplish this, I needed to be able to dynamically set the template to use in the process file element. There are some options to set this template dynamically at runtime using a script task, however, this will only work for the following conditions:
- You must select a default template for the process file element since the designer requires one to be selected
- The default template you select must be based on the same object as the templates you are setting dynamically. This is so you can properly set the filter for the record(s) used for the printable. You have to set this filter at design time, so the object the printable template is based on must be the same or the filter will be invalid.
As long as the conditions above are met, you can easily set the printable template in the process file at runtime using the steps below.
- Set up the Process File element in the process normally (using the default template as specified above)
- Add a process parameter (which can be of type unique identifier or of type lookup using object “Printable”). This is where you will set the printable template to actually use in the process. In my case for the code below, I named this process parameter “PrintableTemplate”.
- get the actual name (Code) of the process file element. To do this, click the top right ellipsis button on the process file element and select “advanced mode”

- Get the Code value of the process file element (this will be used in the script task code). Note, for my process file element, the code is “ReportFileProcessingUserTask1”

- Now add a script task. In this script task, we’ll first get the value of the process parameter containing the printable template to use (in my case, named “PrintableTemplate”). Then, we’ll set this as the template for the process file element, which is stored in the “ReportId” property
var reportId = Get<Guid>("PrintableTemplate");
Set("ReportFileProcessingUserTask1.ReportId", reportId);
return true;
That is it. Now, when the process runs, it will dynamically set the printable template to use for the process file element.



