Save Document to File Builder

The Save Document to File Action builder retrieves a document form the database and saves it to a local directory.

media_1481641731971.png

Select the Document Object Type that will be retrieved.

Click the arrow on the right to select from a list of object types.

Click next once one is selected.

media_1481641772062.png

The Document Criteria will be used to ascertain what document to be retrieved.

media_1481641806486.png

Values can be passed into Criteria by creating a parameter.

By enclosing a value in { } brackets, that flags the word as a parameter. The name of the parameter, in the picture, would be documentName.

Parameters will have the value substituted during the script execution.

media_1481641885235.png

If parameters are found in the Criteria, they wil be listed in the Name drop down.

Name – the name of the parameter within the criteria.

Type – type of value to be expected (String, Bool, Date, Decimal, Number).

Variable – the variable that will hold the value. The drop down will contain existing variables or type in a new variable name.

Click the Add button to add the parameter name and value to be substituted.

media_1481641905116.png

media_1481641952711.png

Click Yes to save the document as a Pdf.

File Path – the variable that will hold the path to the new document file. Note: this variable needs to be set before this point in the script.

Created Script

media_1481642029351.png

Add Text Criteria Parameter – maps a Criteria Parameter to a value to be substituted with.

Find Record By Criteria – retrieves the first record, in the database, that matches a Criteria and sets that record to a variable.

Get Record Content – retrieves the document content from the record and places it into a variable.

 

media_1481642053996.png

New Document Item – creates a new DocumentItem and sets that to a variable.

Set DocumentItem Content – sets the newly created DocumentItem content to the record content variable.

Save Document File – takes a path and saves the document contents using that path.