How to add a decision element for a file upload in a FLOW to check whether the file was uploaded successfully

Salesforce Asked on December 4, 2020

I am trying to display a finish screen after a file upload which should be displayed only if the file upload was a success, so need to add a decision element.I tried using a text collection variable for the document Id in file upload and checking if it’s not null in the decision element but it doesn’t work

One Answer

When I did this about 6 months ago, I manually mapped the contentDocumentIds to a collection variable. It ought to work without that, but I went the manual route, and I would like to believe that was for a good reason.

Then I used an assignment element to set a number variable equal to the size of the collection variable via the equals count operator.

The decision evaluates the number variable and routes to an error screen if no attachment was uploaded.

Not so elegant, but it works. Screenshots below

flow overview


manual mapping (for file upload element in scrUploadFile)

manual mapping

assignment asstSetLength

assignment element

Answered by gorav on December 4, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP