Print this page

Work.com: Goals - How do I import and mass assign goals?

Knowledge Article Number 000193551
Description How do I import and mass assign goals?
Resolution This guide is designed to help salesforce System Administrators import and assign Goals to users en masse. e.g. onboarding Goals, monthly Goals.

Note: This guide covers how to import and mass assign goals via Workbench. It does not cover how to create and assign Goals using the Work.com SOAP APIs. For more information on using the Work.com Goals SOAP API’s, please view the API documentation here.

Templates of all the CSV files described in this guide are available for download in the attachments section at the end of this article.

Before you start, make sure you have the following permissions:

- To set up the environment (one time set up), the Customize Application user permission is required. See here for more information.

- To import goals, the Create and Edit permissions to the Goal objects (e.g. Goal, GoalLinks, Metrics, MetricDataLinks, Task, Event) is required. See here for more information.


1. Setting up the Environment

Importing Goals requires data to be added to the Org in several Work.com objects. Workbench needs a key to ensure it can reference different records across the different CSV data files that will be imported into different objects. The first step is to create the key fields. This is a one time setup.

There is one field that needs to be added to the Goal object: eGoalId

There is one field that needs to be added to the Metric object: eMetricId


1.1. Add External Id fields to the Goal Object

  1. Select SetupCustomizeWork.comGoals | FieldsNew
  2. Choose the Field Type: Text
  3. Enter the details for the new field:
    • Field Label: eGoalId
    • Length: 100
    • Description
    • Check the Do not allow duplicate values option
    •  Check the Set this field as the unique record Identifier from external system option
  4. Click Next
  5. Select the profile(s) which should have access to the new field. Any user who will be importing and assigning goals will require access. For example, System Administrator should be checked.
  6. Select which Page Layouts to add the field to. This can be customized later.
  7. Click Save


1.2. Add External Id fields to the Metric object

  1. Select Setup | Customize | Work.com | Metrics | Fields | New

  2. Choose the Field Type: Text
  3. Enter the details for the new field:
    • Field Label: eMetricId
    • Length: 100
    • Description
    • Check the Do not allow duplicate values option
    • Check the Set this field as the unique record Identifier from external system option
  4. Click Next
  5. Select the profile(s) which should have access to the new field. Any user who will be importing and assigning goals will require access. For example, System Administrator should be checked.
  6. Select which Page Layouts to add the field to. This can be customized later.
  7. Click Save


2. Setting Up The Data To Import

There are two required data files and 4 optional data files to import into the Org. Each file contains a different set of information which, when imported, will mass create and assign the Goals.  The attached templates contain sample data for inserting two goals with two metrics each, and two tasks.

Required data files:
  • 1Goals.csv
  • 2Metrics.csv
Optional data files:
  • 3GoalShares.csv
  • 4MetricShares.csv
  • 5MetricDataLinks.csv
  • 6GoalTasks.csv
 

2.1. 1Goals.csv - Goals

Column HeadingDetails
DescriptionThe description of the goal. The maximum length is 65,535 characters.
DueDateThe date the goal is due. Must be in the form yyyy-mm-dd.
eGoalId__cUnique Id to represent the goal.
NameThe name of the goal. The maximum length is 255 characters.
OwnerIdID of the user who owns the goal.
StartDateThe start date of the goal. Must be in the form yyyy-mm-dd.
StatusThe status of the goal.  Possible values:
  • Draft
  • Published
  • Completed
  • Canceled

 

2.2. 2Metrics.csv - Goal Metrics

Column HeadingDetails
CurrentValueThe current value of the metric.
DescriptionThe description of the metric. The maximum length is 65,535 characters.
DueDateThe due date of the metric.  Must be in the form yyyy-mm-dd.
GoalIdThe eGoal__c value of the goal the metric is related to.
eMetric__cUnique Id to represent the metric.
InitialValueThe initial value of the metric.
NameThe name of the metric.
OwnerIdID of the user who owns the metric.
RecordTypeIdID of the related record type.
StatusThe status of the metric. Possible values include:
  • NotStarted
  • OnTrack
  • Behind
  • Critical
  • Completed
  • Postponed
  • Canceled
TargetValueThe target value of the metric.

 

2.3 3GoalShares.csv - Share records for the goals

When you create goals only the user specified in the OwnerId field will have access to it.  You can open up access by creating sharing rules for the Goal object.  If sharing rules don't quite fit your needs you can manually create sharing rows that determine who else has access to the goal.  Keep in mind that Work.com Admins and Salesforce Admins always have access to the goal, so you won't need to include them in the CSV file.
 
Column HeadingDetails
AccessLevelThe user’s or group’s level of access to the goal. The possible values are:
  • Read
  • Edit
ParentIdThe eGoal__c value of the goal you want to give access to.
UserOrGroupIdID of the user or group that should have access.
 

2.4 4MetricShares.csv - Share records for the metrics

When you create metrics only the user specified in the OwnerId field will have access to it.  You can open up access by creating sharing rules for the Metric object.  If sharing rules don't quite fit your needs you can manually create sharing rows that determine who else has access to the Metric.  Keep in mind that Work.com Admins and Salesforce Admins always have access to the Metric, so you won't need to include them in the CSV file.

 
Column HeadingDetails
AccessLevelThe user's or group's level of access to the goal. The possible values are:
  • Read
  • Edit
ParentIdThe eMetric__c value of the metric you want to give access to.
UserOrGroupIdID of the user or group that should have access.
 

2.5 5MetricDataLinks.csv - records to link reports to metrics

If you would like to link a summary value in a report to a metric you need to specify the details in this file.

 
Column HeadingDetails
DataSourceFieldNameThe field name of the data source, such as a report summary field. As an example if you have summarized a field named Amount in your report the value of this field would be: s!Amount
DataSourceIdThe ID of the report.
TargetIdThe eMetric__c value of the metric that the data is linked to.

 

2.6 6Tasks.csv - tasks that are part of the metric or goal

Column HeadingDetails
OwnerIdID of the User who owns the record. Label is Assigned To ID.
PriorityRequired. Indicates the importance or urgency of a task, such as high or low.
StatusRequired. The current status of the task, such as In Progress or Completed.
SubjectThe subject line of the task, such as “Call” or “Send Quote.” Limit: 255 characters.
WhatIdThe eMetric__c value of the metric that the task is tied to or the eGoalId__c value of the goal the task is tied to.

 

3. Inserting The Data In Salesforce To Create And Assign Goals

Now that the data has been created in the correct format, upload the files in the order outlined below. We recommend using Workbench, accessible here.
  1. Select version 34.0 or later of the API.
  2. Login with salesforce System Administrator credentials.
  3. Select data | Insert from the top menu (repeat this step for each CSV file you are inserting)

3.1. Insert 1Goals.csv into the Goal Object

3.2. Insert 2Metrics.csv into the Metric Object

  • map GoalId to GoalId and smart lookup as Goal.eGoalId__c

3.3. Insert 3GoalShares.csv into the GoalShare Object

  • map ParentId to ParentId and lookup as Goal.eGoalId__c

3.4. Insert 4MetricShares.csv into the MetricShare Object

  • map ParentId to ParentId and lookup as Metric.eMetricId__c

3.5. Insert 5MetricDataLinks.csv into the MetricDataLink Object

  • map TargetId to TargetId and lookup as Metric.eMetricId__c

3.6. Insert 6Tasks.csv into the Task Object

  • map WhatId to WhatId and smart lookup as Metric.eMetricId__c





Attachments
Name Type Size
Templates.zip
1KB

promote demote