As you upload a single file, update standard and custom fields on ContentVersion while in the flow. This post is part of the Uploading and Working with Files in Flow mini series.
Ingredients:
- Install/setup flow package
- Flow: E01_004_CompleteFieldsOnAFile
- Standard File Upload flow screen component (included in the flow)
- Case object – need at least one case record in your org
Video Tutorial (1.75 min)

What’s Happening in the Flow:
- This flow is just like the “Rename an Uploaded File” sample flow, but we’ll update some additional fields on the latest ContentVersion instead.
- For this sample flow, I’ve created a custom field on the ContentVersion object called “Document Type” (included in the unmanaged package). It’s a picklist we’ll use and update in the flow. And for giggles, we’ll also update the standard Description field and the Title field from the last sample.
- “Upload a Single File” element: I’ve added Document Type and Description fields to the screen for the user to complete.
- But I’ve also used conditional visibility to hide File Upload and Description until the user selects a Document Type. Cool, huh? I find that this provides an easier-to-follow user experience.
- “Update Content Version” element: To get to our custom field, we have to directly update the latest ContentVersion record (not ContentDocument like we did in the previous sample). But lucky for us, the ContentVersion record Ids are also available as outputs from the File Upload component.
- Instead of hard-coding a silly new Title for our file like before, I use a Text Template resource called
templateTitle
to pull together values available to the flow to create a standard naming convention for our files. You can also use a formula variable to do this, but text templates are easier (they have less syntax to worry about). - Document Type and Description get set from the values selected or provided by the user on the previous screen.
- Instead of hard-coding a silly new Title for our file like before, I use a Text Template resource called
- That’s it! So not only do you get a cool sample flow, but you also get some freebie examples of using Conditional Visibility for screen components and using Text Template resources to create dynamically-generated field values!
Please review Some Limits for caveats related to this particular use case.
Omg. You save me !
Many thanks
Regards
LikeLike
You save me!
Many thanks for your work.
Regards
LikeLike