Skip to content
flowon.com

Tutorial

Quickstart

Build a validation set, a formula and a logic flow for opportunities, wire them to the Opportunity table with a recipe, and test them.

In this tutorial you build a small piece of sales logic from start to finish. You will check new opportunities for missing or impossible values, calculate their weighted revenue, and email the sales managers when a large opportunity is created. Along the way you use the main Logic Composer building blocks: a project, a validation set, a formula, a logic flow and a recipe. It takes about 30 minutes.

Artifact Name What it does
Project Sales Rules Holds everything you build in this tutorial
Validation set Opportunity checks Stops an opportunity from being saved without a customer, with no revenue, or with an impossible probability
Formula Weighted revenue Calculates estimated revenue × probability
Logic flow Notify sales managers Finds the members of the Sales Managers team and sends them an email about the opportunity
Recipe Opportunity rules Runs the validation set and the flow when an opportunity is created
  • Logic Composer and Logic Composer Tools are installed. See Installation.
  • You have the Flowon Customizer security role.
  • The environment has an unmanaged solution you can use for the project, for example a “Sales customizations” solution.
  • A team named Sales Managers exists, its members have email addresses, and the environment can send email.
  1. Open the Logic Fabric Logic Composer app and go to Logic FabricSettingsProjects.

  2. Select New.

  3. Enter Sales Rules as the Project Name and choose your unmanaged solution in Solution.

  4. Save the project.

Every artifact you create next belongs to this project. You cannot move an artifact to another project after its first save.

A validation set runs several named rules and reports every rule that fails. In a recipe, the names of the failed rules are the message the user sees, so write each name as the sentence you want users to read.

  1. Go to Logic FabricLogicLogic Blocks and select New.

  2. Enter Opportunity checks as the Name and choose the Sales Rules Project.

  3. In the editor, under What should this block work out?, choose Validation set.

  4. On the Input tab, add three inputs:

    Name Type Must have a value
    EstimatedRevenue Currency Off
    Probability Whole Number Off
    Customer Lookup to Account Off

    Leave Must have a value off: checking for missing values is the job of the rules.

  5. Open the Validation Set tab and select Add rule for each of these rules:

    Name Condition
    Estimated revenue must be greater than zero Is Greater Than: EstimatedRevenue > 0
    A customer is required Not Null: Customer is not empty
    Probability must be between 0 and 100 Is Between: IsBetween(Probability, 0, 100)

    Build each condition in the expression editor by picking the function, then filling its slots with the input and a constant. The formula bar shows the result.

  6. Leave Return First Validation Error off, so that every failing rule is reported.

  7. Save the block.

  1. Select Run on the block.

  2. Leave Customer empty, set EstimatedRevenue to 0 and Probability to 150, then select Run (or press Ctrl+Enter).

  3. The result shows the outputs: isValid is false and failedValidations lists the names of all three rules.

  4. Fill in a customer, a revenue above zero and a probability of 40, and run it again. isValid is now true.

  1. Create another logic block named Weighted revenue in the Sales Rules project and choose Formula.

  2. On the Input tab, add EstimatedRevenue (Currency) and Probability (Whole Number). Switch on Must have a value for both.

  3. On the Formula tab, set the result Type to Currency.

  4. Select Write formula and build this expression:

    Round(EstimatedRevenue * Probability / 100, 2)

    Pick Round, then fill its value slot with Divide, whose first value is Multiply (EstimatedRevenue and Probability) and whose second value is the constant 100. Set the digits slot to 2.

  5. Save the block, then Run it with 500000 and 40. The result is 200000.

The formula’s output is always named result. Because a Currency value is involved, the calculation keeps its decimals; see Data types for how number types combine.

The flow uses two steps worth knowing: Resolve Recipients turns a team into a list of users, and Create Email creates and sends the email in one step.

  1. Go to Logic FabricLogicLogic Flows, select New, enter Notify sales managers as the Name and choose the Sales Rules Project.

  2. On the Input tab, add two inputs, both with Must have a value on:

    Name Type
    Opportunity Lookup to Opportunity
    WeightedRevenue Currency
  3. Open the Flow tab and select Add step. Search for recipients and choose Resolve Recipients. Name the step SalesManagers, set Users From to Team and pick the Sales Managers team.

  4. Below that step, select Add step and choose Create Email. Name it AlertEmail and set:

    Setting Value
    To Add Recipient > SalesManagers.Output.users
    Regarding Opportunity
    Subject Format("Large opportunity: weighted revenue {0}", WeightedRevenue)
    Body Concatenate("Please review this opportunity: ", RecordUrl(Opportunity))
    Send the email now Selected

    Record Link (RecordUrl) builds a link that opens the opportunity in the browser.

  5. Save the flow. The Needs setup marker disappears from the step cards.

  1. Select Run on the flow.

  2. Pick an existing opportunity for Opportunity and enter 200000 for WeightedRevenue.

  3. Select Run. The flow has no outputs, so a Succeeded banner is the result to look for.

  4. Check that the members of Sales Managers received the email, and that it appears in the opportunity’s timeline.

A recipe runs your logic when records of one table change. You will validate opportunities before they are created and, after creation, notify the managers when the weighted revenue is at least 100,000.

  1. Go to Logic FabricLogicLogic Recipes, select New, enter Opportunity rules as the Name and choose the Sales Rules Project.

  2. Under Which table does this recipe react to?, search for opportunity and choose the Opportunity table. The table is fixed once the recipe is saved.

  3. On the Create card, use Select Properties to make these columns available: Opportunity, Est. Revenue, Probability and Account.

  4. In stage 1 Validation, select Add validation. Choose Opportunity checks as the Validation Logic Block and map its inputs: EstimatedRevenue to Est. Revenue, Probability to Probability, and Customer to Account.

  5. In stage 3 After Create, select Add action. Set Action Type to Flow, choose Notify sales managers, and map its inputs:

    • Opportunity to the new record’s Opportunity column.
    • WeightedRevenue to Run Logic Block > Weighted revenue with Est. Revenue and Probability as inputs and result as the output.
  6. In Applies When: for the same action, build the condition Weighted revenue ≥ 100000 the same way: Is Greater Than Or Equal To, with Run Logic Block on the left and the constant 100000 on the right.

  7. Switch on Async for the action, so the email is sent in the background and the user does not wait for it.

  8. Save the recipe.

  1. In your sales app, create an opportunity without an account and with no estimated revenue. The save is cancelled and the message lists A customer is required and Estimated revenue must be greater than zero, one per line.

  2. Create an opportunity for an account with Est. Revenue 500000 and Probability 40. The opportunity is saved, and shortly afterwards the Sales Managers receive the email.

  3. Create one with Est. Revenue 50000. It is saved, but no email is sent, because the weighted revenue is below 100,000.