Workday V2 Connector > Workday target approaches > Approach 2: Migrate data from Salesforce to Workday by defining relationship keys for source groups
  

Approach 2: Migrate data from Salesforce to Workday by defining relationship keys for source groups

When you add the closed won opportunity data from Salesforce to Workday, the input groups include opportunity and opportunity line groups on the source side to match the groups in the Workday hierarchical target.
Use the Sorter transformation to sort the input for processing. Define the relationship between the parent and child objects using primary and foreign keys before you map the Salesforce source fields to the Workday target fields.

Creating connections

Before you create a mapping, create a Salesforce connection to read data from Salesforce. Create a Workday connection to write data to the Revenue Management module in Workday.

Create a mapping

Create a mapping to read data from the opportunity object from Salesforce to Workday.
Use the Mapping Designer to configure the mapping. When you create a mapping, configure the data flow of the opportunity object from Salesforce to the Workday target. To write the opportunity data of closed won status from Salesforce to Workday, add the opportunity and opportunity line as source objects from Salesforce.
Because there are multiple groups in the mapping, use a Sorter transformation for data to result as sorted inputs to the Workday target. The sorter helps rows to identify themselves with the right group, and keeps the groupings of each opportunity together.
The following image shows the mapping m_SFDC-WDAY_Oppty_ClosedWon_R2H_Document, with the Source, Expression, and Sorter transformations required before you write data to the Workday target:

Step 1. Add a Source transformation

Configure the opportunity and opportunity line Salesforce source objects. Add a filter to extract data of closed won status.
    1. To create a mapping, click New.
    2. In the New Asset dialog box, click Mapping, and then click Create.
    3. In the Properties panel, enter the mapping name m_SFDC-WDAY_Oppty_ClosedWon_R2H_Document.
    4. To add a opportunity Source transformation, on the Transformation palette, click Source.
    1. a. In the Properties panel, on the General tab, enter a name and description.
    2. b. Click the Source tab, and configure the source details.
    3. The following image shows the configured source details for the opportunity object:
      The Source tab shows the configured Salesforce connection, opportunity source object, and the filter condition.
      In the SOQL Filter Condition field, specify a filter StageName = 'Closed Won' AND WDAY_Prospect_ID__c != null to extract only the valid closed won status information from Salesforce.
    5. To add the opportunity line Source transformation, repeat the steps.
    The following image shows the configured source details:
    The Source tab shows the configured Salesforce connection, opportunity line source object, and the filter condition.

Step 2. Add an Expression transformation

You must add any missing fields for each of the object groups in the transformation before you write to Workday. The Expression transformation must define the relationship of the incoming fields with the target fields.
Before you write to Workday, ensure that each of the groups contains an ID and type. The ID is the unique identifier for an instance of the object in Workday. Type refers to the type of ID value passed for the object in the expression that references the Workday data.
    1. In the Transformation palette, drag the Expression transformation to the mapping canvas.
    2. On the General tab, enter a name and description.
    3. Draw a link to connect the opportunity Source transformation.
    4. On the Incoming Fields tab, you can configure the field rules that define the data that enters the transformation.
    5. On the Expression tab, add the fields, configure the required properties and expressions required for each of fields.
    The following image shows the configured expressions for the fields in the opportunity object:
    The expression includes the reference IDs for currency, opportunity status code, and prospect. Inactive = False indicates that the activity opportunity is active, the Update_only field corresponds to the Update_Opportunity_Only target field.
    6. Repeat the steps to add an Expression transformation for the opportunity line source object.
    The following image shows the configured expressions for the fields in the opportunity line object:
    The expression includes the required field for the opportunity line data in Workday. For the opportunity line group, revenue category is the opportunity line type.
    The following table provides information about the sample configured field names and their expressions:
    Field Name
    Expression
    Description
    o_Opty_Stage_Id_Type
    'Opportunity_Status_Code'
    Specifies the reference ID type used in Workday for opportunity status code.
    o_Stage_ID
    'W'
    The ID that corresponds to the reference ID type for Opportunity_Status_Code. For the stage name of Closed Won status in Salesforce, W is the corresponding value for the reference ID in Workday.
    o_Currency_ID
    'USD'
    The ID that corresponds to the reference ID type for currency.
    o_Currency_Id_Type
    'Currency_ID'
    Specifies the reference ID type used in Workday for currency.
    o_RevenueCategory
    'Product'
    For the opportunity line group, revenue category is the opportunity line type. Revenue category is a required field in Workday.
    o_Inactive
    0
    Inactive = false indicates that the activity opportunity is active.
    o_UpdateOnly
    0
    The Update_only field corresponds to the Update_Opportunity_Only target field, and determines whether you want to update only the opportunity data, or both the opportunity data and the opportunity line item data. You can decide the value based on what you require.
    o_WDAY_Prospect_ID_Type
    'Prospect_Reference_ID'
    Specifies the reference ID type used in Workday for prospect.

Step 3. Add a Sorter transformation

Add a Sorter transformation to each of the sources to sort data in ascending order within each of the objects from Salesforce by ID.
    1. In the Transformation palette, drag a Sorter transformation to the mapping canvas.
    2. Connect the sorter to the data flow of the opportunity expression to the Workday target.
    3. On the General tab, enter a name and optional description for the transformation.
    4. On the Incoming Fields tab, you can configure the field rules that define the data that enters the transformation.
    5. On the Sort tab, add a field, and select the Field as ID and the Sort order as Ascending.
    The following image shows the configured sort condition for the opportunity object:
    You can view the sort condition to sort data in ascending order by ID.
    6. On the Advanced tab, configure the advanced properties:
    The following image shows the configured advanced properties for the opportunity object:
    You can view the advanced properties for the Sorter transformation.
    7. Repeat the steps to add a sorter transformation each to the configured Salesforce objects.

Step 4. Add a Target transformation

Use the Target transformation to define the target Workday connection to connect to Workday and the Put_Opportunity Workday target operation for the mapping.
    1. To add a Target transformation, on the Transformation palette, click Target.
    2. On the General tab, you can enter a name and description.
    3. Draw a link to connect each of the Sorter transformations to the Target transformation.
    4. On the Incoming Field tab, resolve the field name conflicts and ensure that each incoming field has a unique name to distinguish the fields that come from the source objects. Perform the following tasks:
    1. a. In the Bulk Rename Options column, select Prefix to rename the field from Salesforce by adding a prefix.
    2. b. Specify the prefix name.
    3. The following image shows the incoming field names renamed to form unique field names:
      The Resolve Field Name Conflicts dialog box shows the specified prefix to rename specific fields.
    5. Click the Target tab, and configure the target details.
    The following image shows the target properties for the Workday target:
    The Target tab shows the configured connection and the Put_Opportunity operation.
    6. To preview fields, configure the field rules, or rename fields, click Incoming Fields.
    7. Click Field Mapping, and relate all the child elements to the parent element by using primary and foreign keys. Perform the following steps:
    1. a. Under Incoming Fields, navigate to the fields under the source objects to designate the relationship.
    2. b. For example, click the Key icon for the Opt_Id field under the str_Opt parent element.
    3. c. In the Mark as Key dialog box, select Opt_Id as the Primary Key.
    4. d. Navigate to the fields under the srt_OptL object.
    5. e. Designate OptL_Id as the primary key.
    6. f. Designate OptL_OpportunityId as the foreign key and select srt_Opt as the related parent object.
    7. The following image shows the designated primary and foreign keys for the opportunity line child object:
      You can view the primary key for the opportunity object and the designated primary and foreign keys for the opportunity line object.
    8. Map the incoming fields that you want to write to the target.
    The following image shows the mapped fields:
    You can view the mapped fields between the Salesforce source and the Workday target.
    9. Click Save.

Configuring a mapping task

Configure a mapping task, add the configured mapping, and run the mapping to process data based on the data flow logic defined in the mapping.
    1. To create a mapping task, click New > Tasks > Mapping Task, and then click Create.
    2. In the Mapping Task Details area, provide a task name, and provide the configuration details:
    3. Select the configured mapping, and click OK.
    The following image shows the configured mapping task properties:
    4. Configure a schedule and advanced options, if required.
    5. Click Save.
    You can run the mapping manually or on a schedule.