Workday V2 Connector > Workday target approaches > Approach 1: Migrate data from Salesforce to Workday using a Joiner transformation
  

Approach 1: Migrate data from Salesforce to Workday using a Joiner transformation

When you write opportunity data to Workday, you can add the opportunity line element as a Salesforce object along with the opportunity object in the transformation.
Use a Joiner transformation to join the data from the Salesforce opportunity and opportunity line objects before you write that data to Workday. Add the IDs as processing options from the opportunity and opportunity line objects in an Expression transformation.

Creating connections

Create the source and target connections before you create a mapping.

Create a Salesforce Connection

You want to create a Salesforce connection to read data from Salesforce.
  1. 1. Configure a Salesforce connection on the Connections page.
  2. 2. Select type Salesforce.
  3. 3. Configure the advanced properties to connect to Salesforce and save the connection.
  4. The following image shows the configured Salesforce connection properties:

Create a Workday Connection

Create a Workday connection to write data to the Revenue Management module in Workday.
  1. 1. Configure a Workday connection on the Connections page or in a wizard as you configure a task.
  2. 2. Select type Workday.
  3. 3. Configure the connection properties to connect to Workday and save the connection.
  4. The following image shows the configured Workday connection properties:

Creating a mapping

Create a mapping to read data from the Opportunity object from Salesforce to Workday.
Use the Mapping Designer to configure the mapping. Add the opportunity and opportunity line elements as Salesforce objects in the transformation. When you create a mapping, configure the data flow of the opportunity and opportunity line objects from the Salesforce source to the Workday target.
When you configure the Source transformation, select Multiple Objects as the Source Type. Relate the OpportunityLineItem and Opportunity source objects, which joins both the objects. Add the IDs as processing options in an Expression transformation.
For other use cases that does not involve Salesforce as the source, you can use the Joiner transformation to relate different objects.
The following image shows the mapping m_SFDC-WDAY_Oppty_ClosedWon_D2H_MO with the Salesforce source that contains the joined objects, along with the Expression transformation required to write data to the Workday target:

Step 1. Add a Source transformation

Configure the opportunity and opportunity line Salesforce source objects.
    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_D2H.
    The following image shows the configured mapping:
    You can view the name and description for the Salesforce source.
    4. To add an 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. c. Select the configured Salesforce connection.
    4. d. Select Multiple Objects as the Source Type to add related objects. Select a primary object and add related objects from the menu.
    5. e. In the Query Options section, specify the following filter to extract only the latest valid records of closed won status from Salesforce:
    6. Opportunity.StageName='Closed Won' AND Opportunity.WDAY_Company_ID__c!=null and Opportunity.LastModifiedDate >= $LastRunTime
      Note: In this example, WDAY_Company_ID is a custom field in Salesforce opportunity that references an existing Workday company. Use WDAY_Company_ID to select only the closed won opportunities with the requisite data references for successful Workday upsert.
      The following image shows the configured source details:
      The Source transformation includes the Salesforce connection, opportunity and oppoutunityline Salesforce multiple source objects, and the filter.
      The following image shows some of the fields of the opportunity object:
      You can view the fields from the Salesforce object.
    5. Click Save.

Step 2. Add an Expression transformation

To write data to Workday, you must include reference fields that are originally not available in Salesforce. You must create custom fields to include the reference values. Add an Expression transformation to define the relationship of the incoming fields with the target fields. When you configure an expression field, you define the field name, data type, precision, and scale.
The field must contain 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 onto the mapping canvas.
    2. On the General tab, you can enter a name and description.
    3. Draw a link to connect the previous transformation.
    4. On the Incoming Fields tab, you can configure the field rules that define the data that enters the transformation.
    The following image shows the properties for each of the incoming fields:
    You can preview the incoming fields from the Salesforce source.
    5. On the Expression tab, add the custom fields, and configure the expressions for each of the required fields.
    6. Add a new field, provide a name for the field, and select the Output field type and precision.
    The following table is a sample of configured field names and the expressions for each of the field names:
    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_Opty_Stage_ID
    IIF(Opt_StageName='Closed Won','W',(IIF(Opt_StageName='Closed Lost','L','O')))
    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. For the stage name Closed Lost in Salesforce, L is the corresponding value for the reference ID in Workday. If the status is not Closed Won or Closed Lost, the value is O.
    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_UnitCost
    To_char(OptL_UnitPrice)
    Required field for the opportunity line data in Workday. Optionally converts number to string.
    o_Quantity
    To_char(OptL_Quantity)
    Required field for the opportunity line data in Workday. Optionally converts number to string.
    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_Company_ID_Type
    'Organization_Reference_ID'
    Specifies the reference ID type used in Workday for company.
    o_WDAY_Prospect_ID_Type
    'Prospect_Reference_ID'
    Specifies the reference ID type used in Workday for prospect.
    Note: The custom fields, for example, addition of Revenue_Category field to include opportunity lines, is a sample implementation for this use case only. The requirements might vary and will not be consistent across implementations.
    For more information about the fields when you write data to Workday using the Put_Opportunity operation, see the Workday website at: https://community.workday.com/custom/developer/API/Revenue_Management/v26.1/Put_Opportunity.html
    The following image shows the configured expressions for each of the fields:
    You can view the transformations created for the source fields to match the target Workday fields.

Step 3. Add a Target transformation

Use the Target transformation to define the target Workday connection and 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 the Expression transformation to the Target transformation.
    4. 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 Workday connection and the Put_Opportunity operation selected to write to the Workday target.
    5. To preview fields, configure the field rules, or rename fields, click Incoming Fields.
    The following image shows the incoming fields:
    You can view the incoming fields.
    6. Click Field Mapping and map the 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.
    7. Click Save > Save and Close.

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 New Mapping Task Details area, provide a task name, and provide the configuration details.
    3. Select the configured mapping, and click Next.
    The following image shows the configured mapping task properties:
    4. Configure a schedule and advanced options, if required.
    5. Click Finish.
    You can run the mapping manually or on a schedule.