AdvoLogix Help

How do I auto upload Salesforce Files to iManage® Workspace via automation?

Updated

AdvoLogix® provides a built-in Apex method to auto-upload Salesforce Files to iManage® Workspace via Salesforce® Flows.

Creating a Flow to Upload a Salesforce File to a Folder within iManage® Workspace

A background automation can be set using a Platform Event which AdvoLogix® generates for any new Salesforce File uploaded in your organization. AdvoLogix® provides a Flow Template named iManage: Upload Document, which includes the preconfigured setup of actions needed to accept an uploaded Salesforce file, read the file's associated record and then find workspaces associated with that record and upload the file to a specific folder within the workspace.

  1. In Salesforce® setup, enter Flows into the Quick Find box and select Flows.
  2. Select the New Flow action button in the page header to initiate a new Salesforce® flow wizard.
  3. Switch to the All + Templates tab.
  4. Select the iManage: Upload Document template from the list of available templates.
  5. Select the Next button.

You now have a custom flow that will be triggered when a Salesforce File is uploaded. Your administrator can customize the flow elements, including setting up more decision elements or applying more notification elements to inform users about uploaded document actions.

Understanding the Upload Document Flow Template Structure

  1. Choose iManage Event as the platform event Trigger mechanism. AdvoLogix® generates this Platform Event whenever a new Salesforce File is created within your organization.

  2. Add a decision element to filter down the platform events to a specific type that identifies a Salesforce File has been generated in your organization. AdvoLogix® always generates this platform event with Type = SALESFORCE_FILE_ADDED.

  3. After validating the type of platform event ,we retrieve the details of the saved Salesforce File using Get Salesforce File Data and Get all Linked Entities to the Salesforce File elements which provides all of the fields' data for the Salesforce File and all linked entities such as account, case, or other object records this file is associated with at present, respectively.

  4. A loop element that traverses all of the linked entities of the Salesforce File.

  5. A decision check has been added to further filter down which specific linked record's workspace we would like the saved file to be uploaded to in iManage®. This decision is being made using the first three character-based identification of the linked entity's record id, which remains unique throughout your organization objects and can easily identify the object type of the linked record.
    (If you want to copy a Salesforce File for a different linked object, then you should change this element decision criteria to verify a different object as the flow template will be set to check for the account as the default linked entity for the uploaded Salesforce File.)

  6. Execute Find Workspaces, labeled as Find all Workspaces, Apex action provided by AdvoLogix® as an iManage® utility method. Find Workspaces Apex method supports the following parameters:
    • Record ID - Provide the Salesforce record's record Id value here. (In this template, this should be the LinkedEntityId field's value from Step D)
      (For more details about this Apex Action follow
      this article)
    • Login As User ID - Optionally, provide a user id to automatically authenticate all iManage Work related operations within this flow action. The provided user must be enabled as Secured Login within iManage Setup. For more details follow this article.

  7. A loop element that traverses all Workspaces found for the associated record.

  8. Execute Upload Document, labeled as Upload Documents to iManage, Apex action provided by AdvoLogix® as an iManage® utility method. Upload Document Apex method supports the following parameters:
    • Content Version ID - Provide the Salesforce File record's record Id value here.
    • iManage Library - Provide an iManage library name. (In this template, this can be retrieved from the Find Workspace's database field value in Step F and Step G).
    • iManage Workspace - Provide an iManage workspace id. (In this template, this can be retrieved from the Find Workspace's id field value in Step F and Step G).
    • iManage Folder Name - Provide the name of the folder that exists within the workspace retrieved from the Find Workspace action in Step F and Step G.
      (For more details about this Apex Action follow this article)
    • Login As User ID - Optionally, provide a user id to automatically authenticate all iManage Work related operations within this flow action. The provided user must be enabled as Secured Login within iManage Setup. For more details follow this article.

  9. Make a chatter post on the record when the document is uploaded successfully in iManage®.

  10. Make a chatter post on the record when the document upload fails with some error details encountered during the process.

  11. Make a chatter post on the record when we are not able to find any workspaces configured or associated with the Salesforce record.

  12. Make a chatter post on the record when the process to find all associated workspaces is encountered with any error.

In situations where you don't want a copy of your document stored in Salesforce Files, you may add an additional action item in the flow just before Step I, and add a Delete Records action element to delete the Salesforce File or update the Salesforce File with reference to your newly uploaded iManage document's URL.

Due to certain platform limitations, only a small size document (maximum 3 MB) can be transferred from Salesforce Files to iManage®. 

To support larger files, up to 1 GB size, enable the Use AWS Cloud for File Uploading option in iManage Setup | iManage Configuration.

When the Library Name is provided, workspace operations are executed within the specified library, otherwise the workspace operations are executed within the library specified in the iManage Workspace Manager configuration for the object.

When a Login As user is provided within the app builder deployment options, all operations related to iManage Work are performed on behalf of that selected user. The current user cannot log in or log out from iManage Work from within the component. 

If the provided secured logged in user logs out from their environment, then the user is logged out from all instances of the components where the secured login has been setup to use as via the Login As option.

Previous Article How do I create an iManage® Folder via automation?
Next Article How do I update an iManage® Workspace name via automation?
Still need help? Contact Us