When a Oneflow contract is created in Salesforce, it is possible to pull product-related information from any Salesforce object (including custom objects) to populate the Oneflow product table as the contract is created. This logic is defined by the Oneflow Mapping: Products flow.
You can find this flow in Setup > Process Automation > Flows > Oneflow Mapping: Products.
Why Modify the Default Flow?
Modifying the default configuration of the Oneflow Mapping: Products flow allows you to transfer products to different product groups in the Oneflow contract, without being limited to the default product group configuration we provide. This customization also lets you map various product fields to the Oneflow contract product fields based on your business requirements.
For example, in the default flow configuration, the Opportunity line item sales price is mapped as the Oneflow Product Price 1. However, if you want to map a different product field as Price 1, this can be achieved through flow customization.
Flow inputs
The input to the flow is the ObjectApiName and the RecordId of the record from which the contract will be created.
The default Oneflow Mapping : Products flow is based on opportunity line items and queries for the related Opportunity Line Items and Products. However, you may query any object/custom object. These records are converted into an OFapp__OneflowProduct datatype. The result of the flow is a collection of OFapp__OneflowProduct items. With the new Oneflow package update (version 4.xx), this flow now supports setting multiple product groups and synchronizing product updates from Salesforce to Oneflow (including product create and delete) after you create the contract.
The OFapp__OneflowProduct data type has the following attributes:
Attribute | Required? | Description |
Name | Yes | The description of the product. |
Description | No | The description of the product. |
Price 1 Base Amount | Yes | The first unit price. |
Price 1 Discount Amount | No | The first discount amount. |
Price 1 Discount Percent | No | The first discount percentage. |
Price 2 Base Amount | No | The second unit price. |
Price 2 Discount Amount | No | The second discount amount. |
Price 2 Discount Percent | No | The second discount percentage. |
Quantity Amount | Yes | The amount of this product you want on the contract. |
Quantity Type | No | The type of quantity of this product. Defaults to Quantity. Available options:
To read more about quantity type refer here. |
Customize mapping of products fields
Oneflow provides the default mapping for the following Product attributes if you are creating a contract from an Opportunity:
Oneflow Product Field | Opportunity Line Item Field |
Name (Product Name) | Opportunity Line Item Name |
Description (Product Description) | Opportunity Line Item Description |
Quantity Type (Single Choice, Multiple Choice, Quantity) | Opportunity Line Item Quantity Type |
Price 1 Base Amount (Product Price 1) | Opportunity Line Item Sales Price |
Price 1 Discount Percent (Product Discount Percent 1) | Opportunity Line Item Discount Percent |
Product Group Name | Opportunity Line Item Product Family |
Quantity Amount (Product Quantity) | Opportunity Line Item Quantity |
However, you can add additional mapping for Price 1 Discount Amount, Price 2 Base Amount, or Price 2 Discount (Amount or Percent) or change the existing mapping.
- You must modify the Oneflow mapping Products flow and add assignments to the Create Oneflow Product Line Item assignment variable to set the Salesforce values to the Price 1 Discount Amount, Price 2 Base Amount, or Price 2 Discount (Amount or Percent).
- Also you can change the existing mappings to transfer values of the other Salesforce product field values to the already mapped Oneflow product fields such as Price_1.
For example, here I mapped the Opportunity line item list price as a Oneflow Product price_2 base amount.
Customize product groups
You can customize product mapping flow to transfer Opportunity line items to different product groups in the Oneflow contract.
To do this,
- First, you need to change the values of outcomes in the Check product groupdecision variable according to the product family picklist values you have in the product object in Salesforce. If you have more than three product groups in the template, make sure to add new outcome paths to the decision variable.
- After that, you need to configure the Value field of the Assignment variable (Set product group order to x) in each outcome path. The Value field represents a product group number in the Oneflow template.
Here's how this process operates.
- In product group mapping process, the flow first checks the opportunity line item product family in the Check product group decision variable.
- In the next step (Set product group order to x), it assigns the appropriate Oneflow product group number for the OneflowProductLineItem > product_group > order to set the product group. After that those products will be transferred to the relevant product group in the Oneflow contract.
Note:
Products without a product family or with an invalid product family will be transferred to the product group defined on the Default Outcome in the flow. However if the product group number exceeds the number of product groups in the template these products will be transferred to the last product group in the Oneflow contract.
If you haven't set up a Salesforce product family field to configure the Oneflow product groups for Salesforce products, you need to create new options in the Product Family Picklist field of the Product object.
To do this, go to Setup > Object Manager > Product > Product Family and under the Product Family Picklist Values title click the New button, and add the options for product family (Ex: Type 1, Type 2, etc.).
If you want to use multiple product groups in the default flow configuration you need to add Type 1 and Type 2 picklist values.
Setup the product attributes you want to transfer to Oneflow
With the Oneflow settings, you can disable or enable the synchronization of product attributes. For example, when you create a contract, you can prevent the product price from being sent to the Oneflow contract.
To setup this
- Go to the Oneflow Configuration page
- Go to the Product Attributes tab
- You can see all the Oneflow product attributes listed in the Product Attributes table, with check boxes in front of each attribute. Uncheck the boxes for the fields you don’t want to sync. Also you will notice there are two different options
- Salesforce >> Oneflow:Activating this will start syncing product updates from Salesforce to Oneflow contracts.
Note: Please note that product name is a required attribute, so don’t uncheck it.
- Oneflow >> Salesforce: Activating this will sync product updates from Oneflow to Salesforce
- Salesforce >> Oneflow:Activating this will start syncing product updates from Salesforce to Oneflow contracts.
Note:
By default, only the Salesforce to Oneflow sync is enabled for all the product attributes.
How to send product information from Salesforce to Oneflow
- During contract creation: When you create the contract, the Opportunity product information is automatically sent to Oneflow based on the product mapping flow configuration.
- After creating the contract: Click the Update button on the contract card to send product updates after creating the contract.
After that confirmation window will popup. Click on update button to confirm.