Appiphony
 
  • Products
    • Merge Connect Document Generation
    • eSign Connect Docusign Integration
    • Parse Connect Document Parsing
    • Share Connect SharePoint Integration
    • Drive Connect Google Drive Integration
    • Experience Connect Experience Cloud Add-on
  • Company
  • Resources
    • Documentation Learn about our products
    • Blog Salesforce guides and tutorials
    • Customer Stories How our customers succeed
    • Videos Visit our YouTube channel
    • Company Get to know Appiphony
    • Careers View openings
    • PDO Services Build with Appiphony
    • PDO Customer Portal Access our customer portal
  • Pricing
Product Documentation Contact Us

Decision Trees

Share Connect Automation allows users to automatically generate a Share Connect template and link it to the SharePoint Links component by selecting New File from the Template operation in a Record-Triggered flow. This article will show you an example of how you can create different documents based on fields in Salesforce using Decision Trees.

Automate Generating Different Documents using Decision Trees in Salesforce Flow

In this example, we will create a record-triggered flow that runs based on the condition of an Opportunity’s stage. Within the flow, there will be a decision tree that will determine which Automate Share action will run.

  1. Navigate to Salesforce Setup.
  2. In the search box, type "Flows" and go to the Flow page. Choose New Flow in the top right corner.
  3. We will create a Record-Triggered Flow, meaning that when a record is created or updated, this flow will automatically run. For this example, let’s say we only want our Flow to trigger when the opportunity stage is set to Negotiation/Review.
  4. Under Configure Start, select:
    • Object – Opportunity
    • Trigger a flow when – A record is updated
    • Condition Requirements – All conditions are met (AND)
    • Field – StageName 
    • Operator – Equals
    • Value –  Negotiation/Review
    • When to Run… – Only when a record is updated to meet the condition requirements
  5. Next, back in the Flow screen, we will add a Decision Tree node. This node will have 2 outcomes based on the Opportunity Type field: Existing Business, and New Business.
  6. In your New Decision node, set the following:
    • Label – New or Existing Business
    • Outcome Label – Existing Business
    • Condition Requirements – All conditions are met (AND)
    • Resource – To find the Opportunity type field, you must first choose the global variable called $Record. Then you will search for the field you want your decision to be based on. In this case, it is the Opportunity Type field.
    • Operator – Equals 
    • Value – Existing Business
  7. Click the (+) next to Outcome Order.
  8. In your New Outcome, set the following:
    • Outcome Label – New Business
    • Condition Requirements – Any Conditions are Met (OR)
    • Resource – To find the Opportunity type field, you must first choose the global variable called Triggering Opportunity. Then search for the field you want your decision to be based on. In this case, it is the Opportunity Type field.
    • Operator – Equals 
    • Value – New Business
  9. Finally, we will add Automate Share Apex Actions to each decision node. Let’s start with the Existing Business outcome.
    • Add an action for the Existing Business outcome.
    • Search for the Automate Share Action
    • Choose the File from Template option
    • Add the template meant for the existing business outcome, which, in this example, is “Existing Business Agreement”.
  10. Repeat the previous four steps under the New Business outcome while using the template intended for that outcome. The end result will have two Apex actions, one under each outcome.
  11. Click Save and Activate.

Testing the Flow

  1. Now that our Flow is activated, we can test it using two opportunities. The first Opportunity has an Opportunity Type Field set to New Business.
  2. Once we set the opportunity stage to Negotiation/Review, the Flow will run. It will then look for the Opportunity Stage, and since it’s set to new, it will generate a New Client Agreement.
  3. Let’s look at another Opportunity where the Opportunity Type Field is set to Existing.
  4. If we flip the stage to Negotiation/Review, the same flow will run, but it will now generate an Existing Client Agreement because the Opportunity Type Field is set to Existing.

Getting Started

  • Introduction
  • Installation & Setup
  • FAQs
    • Why Can't I Establish an Inbound Connection?
    • Issues Installing Share Connect: Dynamic Imports are Not Allowed
    • Why are my Schedule-Triggered Flows not working?
    • How do I update Share Connect?
    • Why Can't I Preview Files in Safari?
    • Can I Trial Share Connect?
    • How is Share Connect used in a sandbox environment?
    • How do I open a support ticket with the Share Connect team?
    • Can I provide the Share Connect team with feedback?
    • How do I sign out of my Microsoft account in Share Connect?
    • How to Leave an AppExchange Review for Share Connect
  • Release Notes

Features

  • File Management
    • Linking
    • Viewing
    • Downloading
    • Renaming
    • Unlinking
    • Saving to Salesforce
    • Metadata Mapping to SharePoint
    • Uploading to SharePoint
    • Emailing Files
  • Folder Management
    • Linking
    • Viewing
    • Renaming
    • Unlinking
    • Default Folders
    • Content Folders
  • Automation
    • Automation Setup
    • Creating Automations
    • Automating File Upload
    • Automating Email-To-Case Uploads
    • Updating Files
    • Automating SharePoint Metadata Updates
    • Automating Files
    • Destination Locations
    • Automating Folders
    • Publishing Platform Events

Integrations

  • Merge Connect
    • Merging from SharePoint Links Component
    • Merging with Record-Triggered Flows
    • Merging SharePoint Images
    • Decision Trees
  • eSign Connect
    • Attaching SharePoint Documents to Envelopes
  • Experience Connect
    • Sharing Files & Folders Through Experience Cloud
    • Uploading through the Files Component
    • Uploading through the File Uploader Component

Billing

  • Purchase
  • Manage
    • Licenses
    • Tiers
    • Term
    • Payment Info
    • Cancellation

Products

  • eSign Connect
  • Parse Connect
  • Share Connect
  • Merge Connect
  • Drive Connect
  • Experience Connect

Pricing

  • Drive Connect Pricing
  • eSign Connect Pricing
  • Share Connect Pricing
  • Merge Connect Pricing
  • Parse Connect Pricing
  • Experience Connect Pricing

Resources

  • Documentation
  • Blog
  • Customer Stories
  • Videos
  • Company
  • Careers
  • PDO Services
  • PDO Customer Portal

© 2026 Appiphony, LLC. All rights reserved.

Various trademarks held by their respective owners.

Manage Cookies • Policy & Terms