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.

 

 

Troubleshooting

Flow terminates without outputting a file after execution

If the flow terminates without outputting a file after the flow is executed, the error processing may not have been implemented properly. Be sure to obtain the "isSuccess" and "errorMessage" of the return value of the OFC flow component, and branch processing according to the "isSuccess" value. If "isSuccess" is "false," implement processing in case of an error, such as displaying the "errorMessage" value on the screen.

 

 

File output processing does not start after the execution of a flow

If the file output process does not start after the flow is executed, it is possible that the variable "recordId" or "ids" is not properly passed to the OFC flow component. Check that the values of the "recordId" and "ids" variables are set correctly before executing the OFC flow component.

How to check

  • Create a new temporary variable "tempRecordId" of text type.
  • Add a flow "Assignment" before the OFC flow component and assign the value of recordId to "tempRecordId", or in the case of "ids", assign it in the loop process.
  • Check the "Assignment" on the debug screen and confirm that the "recordId" is assigned to "tempRecordId".

If "recordId" is correctly assigned to "tempRecordId" but no output is generated, set "tempRecordId" to the record Id of the OFC flow component.

 

 

The error message "Failed to read static resource OFC_Zip." error message appears.

Clear your browser cache and try again. If clearing the browser cache does not resolve the issue, close and restart your browser. If Lightning Web Security is enabled when outputting using a flow from the list view or the flow debug screen, an error message may appear after upgrading.

 

 

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 -