[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-30 (世界標準時間)。"],[],[],null,["# Sending data to Salesforce Campaigns\n\nYou can use Looker's Salesforce Campaigns integration to create campaigns in Salesforce and populate the campaign members with leads and contacts from a Looker Explore or Look. You can choose to create a new campaign or append users to an existing campaign in Looker.\n\nSetup requirements\n------------------\n\n- Salesforce API v42.0 and later (released Spring 2018)\n- Users will need \"Create\" and \"Edit\" [permissions](https://help.salesforce.com/s/articleView?id=sf.admin_userperms.htm&type=5) on the Campaigns object (this is associated with the \"Marketing User\" profile by default) as well as the \"Marketing User\" checkbox selected on their user profile\n - If you do not have sufficient permissions, you may see the following error message: `entity type cannot be inserted...`\n\nSetup instructions\n------------------\n\n1. Create a [user attribute](/looker/docs/admin-panel-users-user-attributes#creating_user_attributes) to control access to the action and specify the Salesforce domain. On the **User Attributes** page in the **Users** section of the **Admin** menu, click **Create user attribute**. Define your new user attribute:\n\n - Name: **salesforce_campaigns_action_domain**\n - Label: **Salesforce Campaigns Action Domain**\n - Data Type: **String**\n - User Access: **View**\n - Hide Values: **No**\n - No default value\n\n Select **Save**.\n2. Once you define a user attribute, you can assign Salesforce domain (for example, \"https://MyDomainName.my.salesforce.com\") as a *value* to the individual users and user groups that will use the action. Select the **User Values** and **Group Values** tabs at the top of the **User Attributes** page to assign values to [individual users](/looker/docs/admin-panel-users-user-attributes#assigning_values_to_individual_users) and [user groups](/looker/docs/admin-panel-users-user-attributes#assigning_values_to_user_groups), respectively.\n\n - Different users can target different domains (for example, a Staging or Development Salesforce instance), and you can update the domain value at any time.\n - Users who do not have an assigned value will not see the action as a destination option.\n3. Next, enable the action. Go to the **Actions** page in the **Platform** section of the **Admin** menu, and select **Enable** next to the **Salesforce Campaigns Action Domain** action. On the **Salesforce Campaigns Action Domain** page, enable the **Enabled** toggle, and select the **Salesforce Campaigns Action Domain** user attribute for the **Salesforce domain** field. Click **Save**.\n\n4. Optionally, set up LookML tags `sfdc_contact_id` and `sfdc_lead_id` for contacts and lead fields, respectively. Alternatively, the action will attempt to regex match the field label with the following expressions: `/contact id/i` and `/lead id/i` (case insensitive).\n\nUsing the Salesforce Campaigns action\n-------------------------------------\n\nOnce the Salesforce Campaigns action has been configured, you can use it in the Looker Scheduler:\n\n1. From a Look or an Explore, [create a schedule or select the option to **Send** a one-time delivery](/looker/docs/delivering-looks-explores#creating_a_delivery).\n2. Under **Where should this data go?** , select the **Salesforce Campaigns** action.\n3. The first time you use the action, you will be prompted to log in to Salesforce. Click **Log in**.\n4. On the OAuth consent screen, click **Allow** and return to the Looker Scheduler window.\n5. Select **Verify credentials** . Once you've logged in to Salesforce within the Looker Scheduler, fill out the **Salesforce Campaigns** action form to configure the details of your Look or Explore delivery:\n\n 1. **Create or Append** : Select **Create** create a new campaign or **Append** to modify an existing campaign.\n 2. **Campaign Name**: Enter the name for the new campaign or select an existing campaign.\n 3. **Member Status**: Select the status of the campaign members. This list will be populated from available statuses from your Salesforce instance.\n 4. **Surface Salesforce Errors In Looker** : Set this to **Yes** to surface any Salesforce errors with setting campaign members in Looker's scheduled job status detail. This will record an **Error** in Looker's scheduled job status on the **Schedule History** page in the **Admin** menu, which is useful for troubleshooting errors on a member level. Set this to **No** to ignore all errors related to campaign members (default). This will record a **Complete** status, regardless of any errors that might have occurred when you set up the campaign members.\n6. Specify any other options for your delivery.\n\n7. Select **Send**.\n\nRemoving the Salesforce Campaigns action\n----------------------------------------\n\nIf you want to switch the connected Salesforce instance or disconnect the Looker action from your Salesforce instance, you can [revoke the connection](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_request_manage.htm&) to the Looker application from within your Salesforce account.\n\nLimitations\n-----------\n\n- This action is limited to a maximum of 5,000 rows. The functionality to send all results is currently being developed.\n- Each Salesforce Edition has a limit to the number of API calls that are allowed in a 24-hour period. Refer to the [Salesforce API Request Limits and Alloctions](https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm) documentation to learn your instance's API limits. This action leverages POST requests with [sObject Collections](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobjects_collections_create.htm) to execute multiple records (200 records per API call) in a single request."]]