Use with Screen Flow (for OFC Ver.1)

Output files using Office File Creator in the screen flow.

*Knowledge of flow creation is required. Inquiry support does not cover standard Salesforce functions such as how to create flows, flow errors, etc.

*This procedure is for Office File Creator ver.1. Ver.1 and Ver.2 have different settings. If you are using Ver.2, please refer to the Ver.2 version.

 

How to use in Flow

  • Place the ″officeFileCreatorForFlow component on the Screen Flow. The component is placed on the Screen, but its role is the same as an action, only processing. When moving to the flow screen where the officeFileCreatorForFlow component is placed, the file creation is immediately executed, and when it is completed, the system automatically moves to the next Flow screen or process.
  • The officeFileCreatorForFlow component returns return values such as isSuccess and errorMessage.
  • The Screen Flow in which the officeFileCreatorForFlow component is placed should hide the footer so that users do not click the "Next" or "Previous" buttons while officeFileCreatorForFlow is running.
  • The screen flow behind (immediately after) the screen flow where the officeFileCreatorForFlow component is placed should hide the "Previous" button. If a user clicks "Previous", the form output will be executed again.
  • The officeFileCreatorForFlow component proceeds to the next flow process even if the output fails. To detect errors, include error handling that retrieves the return value of the isSuccess parameter and displays an error message in the event of an error.

 

Screen Properties: "Show Footer" checked off

 

officeFileCreatorForFlow property screen

 

officeFileCreatorForFlow Component Parameters

Parameters Setting details
recordId Record Id

*Multiple record Id's separated by commas are not allowed.

save Set the file output method.

  • Output (download) a file ・・・ blank
  • Save the file as a File ・・・ file
  • Save the file as an Attachment ・・・ att
template Template Api Name of the OFC_Template Record.

 

officeFileCreatorForFlow Component Return Values

Prameters Result Values
isSuccess Returns the success or error of the file output result.

  • True ・・・ Success
  • False ・・・ Error
errorMessage If isSuccess is False, it returns the error content.
filename File name (with extension)
fileNameWithoutExtension File name (without extension)
fileExtension File extension
contentDocumentId If the parameter save is "file", it returns the record Id of the ContentDocument object.
contentDocumentVesionId If the parameter save is "file", it returns the record Id of the ContentVersion object.
attachmentId If the parameter save is "att", it returns the record Id of the ContentVersion object.

 

 

Output from List View

Lightning Web Security must be enabled when the flow is executed in the list view. From Setup > Session Settings, check enable/disable "Use Lightning Web Security for Lightning web components and Aura components".

 

About Enabling Lightning Web Security

  • Before enabling Lightning Web Security in the production organization, it is necessary to confirm in the Sandbox that programs and managed packages in the organization are not affected.
  • About enabling Lightning Web Security, ask your organization's system administrator or Salesforce help.

 

For organizations that cannot enable Lightning Web Security, an alternative is to run the flow with the data table on the application page.

Create documents of selected records in the data table of a Flow in Salesforce

 

Reference

How to deal with a CORS error when executing a flow in a list view and the process does not proceed

Enablement of Lightning Web Security Begins

Secure Your Components Better, Stronger, Faster with Lightning Web Security (Generally Available)

 

 

NoteLimitations

  • Office File Creator cannot be used in a Record-Triggered Flow.
  • Output from screens containing custom development other than record screens (standard) and list views is not supported.
  • Knowledge of flow creation is required. Inquiry support does not cover standard Salesforce functions such as how to create flows, flow errors, etc.

 

 

Reference

Output files and update Opportunity records in Salesforce Flow (for OFC Ver.1) – Office File Creator Advanced –

Output documents and update Opportunity from the List View in Salesforce Flow (for OFC Ver.1) - Office File Creator Advanced -

 

 

Troubleshooting