Users may initially save Files like contracts and signed documents to one Object and later want to transfer those Files or Notes to a different object when records are created. For example, if your Sales team has attached contractual documents to the Sales Appointment, once the Appointment is sold and a Sale is created you may want to see those Files and Notes related to the Sale record instead. This Flow automation covers how to transfer Files and Notes to a different object record upon record creation.
Note: You will need the following System Permission on your User Profile or Permission Set:
Query All Files
The finished Flow will look something like this:
On the Start Node
We will choose anytime a Sale record is Created or Updated
And no condition requirements
Next we'll use a Get Records element to locate any Content Document Links which were attached to the same Sales Appointment ID as the Sales Appointment related to the Sale which triggered the Flow.
Tips & Tricks: You may want to do this JUST for Note records, you would add a secondary Filter Condition Requirement here which isolates just the Note records. Use the Condition of: File Type 'equals' "SNOTE"
Be sure to Store All Records
Next we'll use a Decision node to see if there were records found in the Get action. If the result of the Get action is Null (no records present) then the Default Outcome path does nothing.
This Decision Node indicates if any Content Document Files were found. Use a Global Constant of Is Null False for the positive outcome path (in which Files were found in the Get action).
On the positive outcome path create a Loop element to loop through the records which were found.
Looping through the items from the Collection in the Get Action
Then within the Loop, use a Create Records element to create new Content Document records for each File which was found.
Set the following Fields on the Content Document (or Note) records:
- ContentDocumentID < use the Current Item from the Loop
- Linked Entity ID < Use the Record ID of the Sale which started this Flow
- Visibility < All Users
Your Completed Flow will look something like this:
Also Note: These Files will only appear one time in the File Manager Tool. There will not be duplication of Files and documents displayed in the File Manager tool.
Comments
0 comments
Article is closed for comments.