Add to campaign (obsolete)
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Adds an existing Salesforce lead to one or more campaigns. This older version stores the Salesforce username, password and security token in the action itself.
This action is obsolete. Use Add to campaign with a Salesforce connector instead. The connector keeps the login details in one place, with the password and security token saved encrypted. Existing actions still work, but new applications shouldn't use this one. See Migrating to Add to campaign.
This action is part of the Salesforce add-on (DnnSharp.Salesforce). The add-on is installed separately and needs the SALESFORCE feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Salesforce actions, the add-on isn't installed.
Apart from how it signs in, this action works exactly like Add to campaign. See that page for how it works, errors and considerations.
Typical Use Cases
- Understand or maintain an existing application that already uses it
- Migrate an existing action to Add to campaign
Don't use it to
- Build anything new. Use Add to campaign with a Salesforce connector.
- Add contacts, accounts or cases. The ID is always sent as a lead ID, whatever
Salesforce Entity Typeis set to.
Related Actions
| Action Name | Description |
|---|---|
| Add to campaign | The current version, which signs in with a Salesforce connector. |
| Add Salesforce Connector | Creates a Salesforce connector. |
| Create a Salesforce Entity (obsolete) | Creates a lead or other record, with the login details in the action. |
| Run SOQL Query (obsolete) | Runs a SOQL query, with the login details in the action. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Salesforce Login URL | The Salesforce login domain, for example https://test.salesforce.com for a sandbox. If the value doesn't end with /services/oauth2/token, that path is added. Leave it empty to use https://login.salesforce.com/services/oauth2/token. | Yes | empty string | No |
| Salesforce Username | The Salesforce username. | Yes | empty string | Yes |
| Salesforce Password | The Salesforce password. | Yes | empty string | Yes |
| Salesforce Security Token | The Salesforce security token for the user. | Yes | empty string | Yes |
| Salesforce Entity Type | A list with Lead, Case, Contact and Account. The action ignores this setting and always adds the ID as a lead. | No | empty string | No |
| Entity Id | The ID of the lead to add, for example [LeadId]. Both 15 and 18 character IDs work. | Yes | empty string | Yes |
| Campaign Ids | One or more campaign IDs, separated by commas. Both 15 and 18 character IDs work. | Yes | empty string | Yes |
| Campaign Member Token Name | The name of a token to save the new campaign member ID in, for example CampaignMemberId. | No | empty string | No |
| Campaign Member URL Token Name | The name of a token to save a link to the new campaign member in. See Output Parameters Reference. | No | empty string | No |
| On Successful Add | Actions to run after the lead is added to a campaign. They run once for each campaign. | No | empty | No |
| On Error | Actions to run when the action fails. The [ErrorMessage] token holds the error message. | No | empty | No |
Output Parameters Reference
| Parameter | Description |
|---|---|
[<Campaign Member Token Name>] | The ID of the campaign member record Salesforce created. With several campaigns, it holds the current campaign's member while On Successful Add runs, and the last one after the action ends. |
[<Campaign Member URL Token Name>] | Salesforce Login URL, exactly as entered, followed by / and the campaign member ID. It's only a working link when Salesforce Login URL is your Salesforce domain without a trailing / or the /services/oauth2/token path. If Salesforce Login URL is empty, it's just / and the ID. |
[ErrorMessage] | The error message, set when the action fails. |
Migrating to Add to campaign
- Create a Salesforce connector with the same login details, on the Connectors page (see Connectors) or with Add Salesforce Connector.
- Check it with Test Connector.
- Replace each Add to campaign (obsolete) action with an Add to campaign action:
| Add to campaign (obsolete) | Add to campaign |
|---|---|
| Salesforce Login URL | Login Url on the connector |
| Salesforce Username | Account Username on the connector |
| Salesforce Password | Password on the connector |
| Salesforce Security Token | Security Token on the connector |
| (none) | Connector: pick the new connector |
| Salesforce Entity Type | Salesforce Entity Type (ignored in both) |
| Entity Id | Entity Id |
| Campaign Ids | Campaign Ids |
| Campaign Member Token Name | Campaign Member Token Name |
| Campaign Member URL Token Name | Campaign Member URL Token Name. In the new action it's only / and the ID, so build the link yourself if you need one. |
| On Successful Add | On Successful Add |
| On Error | On Error |
Considerations
- The login details live in the action. They're saved with the action's settings, so anyone who can edit or export the action has access to them. Move to a connector, or at least pass the values through tokens instead of typing them in.
- Every action needs its own copy. When the password or token changes in Salesforce, you must update every action that has it. With a connector, you update it once.
- The other considerations are the same as for Add to campaign: no rollback, duplicates fail, and member status isn't set.
Examples
To understand how to use the below examples, please see Running Examples.
1. Add a lead to a campaign
This action signs in with login details from tokens and adds the lead in [LeadId] to the campaign in [CampaignId]. For new work, use Add to campaign instead.
{
"Title": "Add to campaign (obsolete)",
"ActionType": "AddToCampaign",
"Description": "Add the lead to the campaign",
"Condition": "[LeadId] != \"\"",
"Parameters": {
"sforceLoginURL": "",
"sforceUserName": "[SalesforceUsername]",
"sforcePassword": "[SalesforcePassword]",
"sforceSecurityToken": "[SalesforceSecurityToken]",
"sforceEntityType": "lead",
"EntityId": "[LeadId]",
"CampaignIds": "[CampaignId]",
"CampaignMemberTokenName": "CampaignMemberId"
}
}
Revised 09/27/2026