Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Architecture

TODO: Topics to work outResources for when using Filenize in flows.

Considerations

...

When adding Filenize actions to your flow

...

, it's important to remember that the flow isn't finalized until you include the Filenize commit action at the end. This step is crucial to

...

construct a queueable chain of actions

...

, ensuring that each action runs only after the previous one has finished. Since Filenize actions operate asynchronously, this explicit commitment is necessary to maintain a well-ordered sequence.

By implementing the Filenize commit action, the chain will automatically skip any consecutive actions if an error

...

is encountered. This is particularly useful in scenarios where, for example, a subfolder needs to be created

...

but the parent folder

...

TODO: All actions in the flow are executed First In First Out. But when using the Diagnose Flow utility that comes with Filenize, there might be some differences.

  • When running a flow for one specific record, you just see the actions related to the record in the UI. Pending and actions in the past

  • When running a flow where multiple records are in one DML call, each action is executed n times per record before continuing to the next action

    • This is standard Salesforce flow and bulkily behaviour

    • We stop all consecutive actions after an error occurred which are linked to the same record. The other actions still continue

  • When running a flow where multiple records are saved, but each in their own DML call, all the actions are

Pro

  • Easy to setup for admins and developers

  • Includes in-depth diagnose tooling for spotting incorrect behaviour

    • Also includes rerunning certain actions for trial-and-error testing

  • Provides out-of-the-box user feedback about it’s progress in the Filenize component

Con

...

doesn't exist due to an error. The commit action helps prevent such situations and allows you to design a robust and error-resilient flow.

So, don't forget to include the Filenize commit action at the end of your flow to ensure smooth and reliable execution of your Filenize actions.

Pro

Filenize offers several advantages for admins and developers, making it easy to set up and manage:

  1. Easy Setup: Administrators and developers can quickly set up Filenize without extensive configuration, reducing implementation time and complexity.

  2. Diagnose Tooling: Filenize includes in-depth diagnostic tools, allowing users to identify and address any incorrect behavior or issues effectively. This aids in troubleshooting and resolving potential problems swiftly.

  3. Rerun Actions: Filenize allows rerunning certain actions, which is valuable for trial-and-error testing during development. It facilitates testing and refining processes until the desired outcomes are achieved.

  4. User Feedback: The Filenize component provides real-time feedback to end-users about the progress of their actions. This transparency enhances the user experience and ensures that users are informed about the status of their tasks.

With these features, Filenize streamlines SharePoint integration and enhances usability, making it a valuable tool for administrators and developers looking to optimize their Salesforce and SharePoint workflows.

Con

While Filenize offers several advantages, there are some considerations to keep in mind:

  1. Queueable Design: Each Filenize action is designed as a Queueable, which can be slower compared to running APIs directly in Apex. This design choice is to prevent hitting DML/Callout limitations and ensure the process runs smoothly. Especially needed with bigger folder hierarchies.

  2. Delayed Execution: Executing a Queueable

...

  1. doesn't start the process

...

  1. immediately. Instead, it waits until Salesforce has the necessary resources

...

  1. available for execution. This can lead to some delay in processing actions.

...

Queueables are slower on sandboxes than on production orgs. This is Salesforce’s way to limit resources used.

  1. Slower Performance in Sandboxes: Queueables may perform slower in sandboxes/Developer editions/Scratch Orgs compared to production orgs. Salesforce uses this approach to limit resource usage in these environments.

  2. Asynchronous Processes: Since each action initiates an asynchronous process

...

  1. , the result of that process is not immediately usable in the next consecutive process.

...

  1. While Filenize provides a direct output for folder creation actions

...

  1. , allowing access to the new relative

...

Queueable Groups

Queueable Groups is new in version 2.5. Queueable Groups allows you to automate multiple queues in a serial manner. A flow using Filenize is already executing all actions in a queue one after each other, but with multiple flows - different queues independent to each other - are run in parallel mode. With Queueable Groups you can enforce one queue to wait for another queue. The queue that was created first is then executed first (FIFO).

Example use case with Queueable Groups as the solution

Scenario: You have different flows to create a hierarchy on Account and Opportunity record level. This consists of two separate flows. Running the flow on the Account and directly on the Opportunity level will run the queues in parallel mode. Especially if the account flow is large and takes some time to complete. This can cause issues when the opportunity folder is dependant on the account folder. In this case you want to use Queueable Groups on both the account and opportunity flow. Best practice here is to provide the account id as the Queueable Group identifier, as that value is available both on the account and opportunity. Now the opportunity flow will wait patiently until the account flow has completed all its actions.

Considerations when using Queueable Groups

  • The Filenize component will take longer to load on the record if a dependant queue is currently running. Looking at the example above, the user that created the opportunity needs to wait before the account queue is completely done. This might cause confusion for the end user.

  • Consider the limitations around Queueables, developer editions or trail orgs, those editions only allow a max depth of 5 queues. A queue within a group waits for other queues in the same group to complete by queueing itself again until its the queues turn. Because of this behaviour it’s possible that the process reaches 5 queues before the actual process has even started. The error “Maximum stack depth has been reached“ is then shown.

Order of Execution

When using Filenize actions, the order of execution and behaviour can differ depending on the way the actions are triggered. Below a couple of scenario’s and the expected behaviour. The scenarios assume a DML flow is configured, only 2 records exist with the name A and B, the flow is simple with only 3 actions: Create folder, Share folder, Unshare folder or simply X, Y, Z. (Note: The order of the actions inside the flow is always serial, we are looking at the order of multiple flow executions and how they work together).

Non Grouping

The Commit action is used at the end of the flow without using a Queueable Group.

Scenario 001: DML includes record A and B

  • Due to the nature of flows handling bulkified data, the order is serial, but by processing each action in the flow for all records in the DML call before continuing to the next action. (A:X > B:X > A:Y > B:Y > A:Z > B:Z). Actions are within one queue.

  • Both A and B actions are visible in the Diagnose Flow UI because the dependancy.

  • Filenize skips consecutive steps if an error occurs in the previous one, but only the actions with the same record reference.

Scenario 002: Two DMLs for record A

  • The actions run in their normal order but each flow in their own queue, causing the two to run parallel

  • The actions are only visible on record A due to no dependancy

  • Upon an error all consecutive actions inside a queue are skipped

  • NOTE: Running the same process twice at the same time can cause SharePoint lockup issues. i.e. Trying to write an existing folder when it’s still being written.

Scenario 003: Two DMLs for record A and B

  • The actions run in their normal order but each flow in their own queue, causing the two to run parallel

  • The actions are only visible for their own record, they are not dependant on each other

  • Upon an error all consecutive actions inside a queue are skipped

Scenario 004: Two DMLs in a separate transaction for record A

  • The actions run in their normal order but each flow in their own queue, causing the two to run parallel

  • The actions are only visible for record A due to no dependency, both transactions are shown

  • Upon an error all consecutive actions inside a queue are skipped

Grouping

The Commit action as a Queueable Group is used at the end of the flow.

Scenario 005: DML includes record A and B

  • Same as the non grouping behaviour. Multiple records in one DML always have a dependancy with each other. Group or no group.

Scenario 006: Two DMLs for record A

  • The actions run in their normal order but each flow in their own queue, the last queue waits until the first one is done before running. Making the process serial

  • The actions are only visible on record A due to no dependancy

  • Upon an error all consecutive actions inside a queue are skipped

  • NOTE: Beware of the “Maximum stack depth has been reached.“ error. See considerations above.

Scenario 007: Two DMLs for record A and B

  • The actions run in their normal order but each flow in their own queue, the last queue waits until the first one is done before running. Making the process serial

  • All actions are visible for both records because the shared queueable group. This causes the two to have a dependancy

  • Upon an error all consecutive actions inside a queue are skipped

  • NOTE: Beware of the “Maximum stack depth has been reached.“ error. See considerations above.

  • NOTE: Creating a flow with a static group for all processes will result in a long list within the Flow Diagnose, because all actions are dependant on each other. Best practice is to use a value that makes sense for the dependancy. I.e. You can reference the account id as the group for your account, opportunity, quote flows. Making sure the opportunity and quote folder creation flows only run after the account flow is done.

Scenario 008: Two DMLs in a separate transaction for record A

...

The actions run in their normal order but each flow in their own queue, the last queue waits until the first one is done before running. Making the process serial

...

The actions are only visible for record A due to no dependency, both transactions are shown

...

Upon an error all consecutive actions inside a queue are skipped

...

  1. URL before execution, other actions may have a slight delay in obtaining results.

Despite these considerations, Filenize remains a powerful tool for integrating Salesforce with SharePoint, providing effective management of files and documents between the two platforms. Administrators and developers can leverage Filenize's capabilities while being mindful of its asynchronous nature and potential performance implications.

Enter Flows

With Flows, you can now automate the process of creating and pinning folders in Salesforce, among other tasks. For example, you can automatically create an account folder for each new account or create a contact folder under the corresponding account folder. The automation tools provided by Filenize also enable you to automatically pin the folders. This means that when you open a specific account record, the corresponding folder will open alongside it, providing a seamless and efficient user experience.

To leverage Filenize's automation features, the SharePoint instance name is required. This allows Filenize to connect with the correct SharePoint site, subsite, or document library, ensuring that the automation processes are applied accurately and efficiently. By using Flows and Filenize together, you can streamline your Salesforce workflows and optimize your file management processes.

Info

That's right! "Pinning" is a handy feature in Filenize that allows you to link a SharePoint folder directly to a Salesforce record. Whenever you open the Filenize component, it smartly identifies the appropriate folder for you based on the current Salesforce record you're viewing. This seamless integration ensures quick access to the relevant documents and files related to your records, making your workflow more efficient and user-friendly.

By "pinning" folders to your Salesforce records, you can effortlessly manage your files and documents, eliminating the need to manually search for the right folder each time. Filenize simplifies this process, allowing you to focus on your tasks without the hassle of navigating through SharePoint separately. It's just one of the many ways Filenize enhances your Salesforce experience and streamlines your document management processes.

To create and pin a SharePoint folder using Filenize in a Flow, follow these steps:

  1. Create or open an existing Flow in Salesforce.

  2. Select a new Action element within the Flow.

  3. Search for "SharePoint" to find all the actions that come with Filenize.

  4. Choose "Create and Pin a SharePoint Folder" from the available actions.

  5. Customize the action properties to match your business needs. In this example, we'll create a folder for each new account in Salesforce, and the following values apply (your values may differ based on your solution):

    • Folder Name: Field Reference => {!$Record.Name}

    • Record Id: Field Reference => {!$Record.Id}

    • SharePoint Instance Id: String => Your SharePoint Instance Name

    • Reset Sharing on Folder (Optionally): Usually set to true for root folders with custom sharing

    • Server Relative URL: String => A fixed path or a reference to a previous folder action

  6. Save and activate the Flow.

By following these steps, you ensure that a new account folder is automatically created and pinned to the respective account record. Feel free to customize the action properties based on your unique business requirements and workflows.

...

Next Steps

The "Create and Pin a SharePoint Folder" action is just the beginning of the powerful features Filenize offers. You have a whole array of actions at your disposal to customize your folder hierarchy according to your business needs.

To explore all the possibilities Filenize has to offer, make sure to visit the Actions page. There, you'll find a comprehensive list of actions with detailed explanations of how each one can be used to optimize your file management processes.

If you're looking for practical examples and step-by-step guides, head over to the Examples page. It's filled with real-life scenarios where Filenize actions are applied, providing valuable insights to inspire and guide you in customizing Filenize for your organization.

With Filenize, you can take your Salesforce and SharePoint integration to a whole new level, streamlining your workflows and enhancing collaboration. So don't wait! Check out the Actions and Examples pages to unlock the full potential of Filenize and tailor it to suit your unique business requirements. Happy exploring!