This lesson will cover the following topics:

02 | Flow

01 Getting Started

This tutorial covers how to use Titan Files to automatically extract all files from a zip archive, and then delete the original zip file.

This is a useful process to implement if you need to upload multiple documents to Salesforce, as you can upload a single zip archive containing all the files. By extracting the files, they are readily available.

02 Flow

1. Navigate to Process Automation Flows in Salesforce and click New Flow.

Creating new flow

2. Select Record-Triggered Flow and click Create.

new flow > record-triggered flow

3. Configure the following: 

  • Object - TFile
  • First condition - The Parent Object equals Case (you can set this to be any Object where the zip file will be uploaded to.
  • Second condition - The file extension equals zip.

object configuration

4. Save and Label your flow.

5. Click the + icon.

add new node

6. Search for the File Action node and select it.

add file action node

7. Configure the following: 

  • Label - Unzip
  • Parent Object - Case

8. Select the Settings icon in the Flow window.

flow settings

9. Click the Files menu item under Variables, Add a Files Variable, and name it output_file. Click Apply.

add file variable

10. In the Titan Flow window, click the Any + icon and select Extract as the node. Click Next.

add extract node

11. Select the file variable in the File In dropdown.

12. Select the output_file variable using the File Out dropdown. Click Next.

configure the file in and file out

13. Add a tag and click Insert.

14. Click the Extract Zip File + icon and choose Salesforce Action as the node. Click Next.

add a salesforce node

15. Click Salesforce Integration.

salesforce integration button

16. Select the Push tab and click Create New.

create new salesforce push

17. In the Object Settings tab configure; files as the Salesforce object, create as the action, and create files as the description.

object settings tab

18. In the Mapping tab configure the following and click Apply.

  • Map the Version Data to the output_file variable. This will create a separate Content Version for each extracted file.
  • Map First Publish Location ID to the parentRecordId global variable

mapping tab

19. Click Create New to configure a new push.

20. In the Object Settings tab configure; Content Document as the Salesforce object, Delete as the Action, and add a description.

Object settings tab

21. In the Conditions tab, configure that the Content Document ID equals the contentDocumentId field. Click Apply and Close.

conditions tab

22. Using the dropdown to select both Salesforce pushes. Ensure you select the pushes in the order they should run i.e. push the extracted files first then delete the zip file. Click Next.

selecting the configured push

23. Add a Tag and click Insert.

24. Click Done in the Apex configuration window.

25. Save the updated flow and Activate.

The current configuration will be triggered when a zip file is uploaded to a case, the file will be unzipped, and the original archive zip will be deleted.

03 Got Feedback?