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.
|
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.
|
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)
Note・Limitations
- 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
Troubleshooting
- Screen Flow terminates without outputting a file after execution.
- File output processing does not start after the execution in Screen Flow.
- When a Screen Flow is executed in the list view, it does not proceed from the processing screen.
- When executing a Screen Flow from the list view or the flow debug screen, the error message "Failed to read static resource OFC_Zip. Please clear your browser cache and try again." is displayed.