Skip to main content
Version: 1.28 (Current)

Add to campaign (obsolete)

Audience: Low-code Engineers

Skill 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.

caution

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.

note

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 Type is set to.
Action NameDescription
Add to campaignThe current version, which signs in with a Salesforce connector.
Add Salesforce ConnectorCreates 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​

ParameterDescriptionSupports TokensDefaultRequired
Salesforce Login URLThe 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.Yesempty stringNo
Salesforce UsernameThe Salesforce username.Yesempty stringYes
Salesforce PasswordThe Salesforce password.Yesempty stringYes
Salesforce Security TokenThe Salesforce security token for the user.Yesempty stringYes
Salesforce Entity TypeA list with Lead, Case, Contact and Account. The action ignores this setting and always adds the ID as a lead.Noempty stringNo
Entity IdThe ID of the lead to add, for example [LeadId]. Both 15 and 18 character IDs work.Yesempty stringYes
Campaign IdsOne or more campaign IDs, separated by commas. Both 15 and 18 character IDs work.Yesempty stringYes
Campaign Member Token NameThe name of a token to save the new campaign member ID in, for example CampaignMemberId.Noempty stringNo
Campaign Member URL Token NameThe name of a token to save a link to the new campaign member in. See Output Parameters Reference.Noempty stringNo
On Successful AddActions to run after the lead is added to a campaign. They run once for each campaign.NoemptyNo
On ErrorActions to run when the action fails. The [ErrorMessage] token holds the error message.NoemptyNo

Output Parameters Reference​

ParameterDescription
[<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​

  1. Create a Salesforce connector with the same login details, on the Connectors page (see Connectors) or with Add Salesforce Connector.
  2. Check it with Test Connector.
  3. Replace each Add to campaign (obsolete) action with an Add to campaign action:
Add to campaign (obsolete)Add to campaign
Salesforce Login URLLogin Url on the connector
Salesforce UsernameAccount Username on the connector
Salesforce PasswordPassword on the connector
Salesforce Security TokenSecurity Token on the connector
(none)Connector: pick the new connector
Salesforce Entity TypeSalesforce Entity Type (ignored in both)
Entity IdEntity Id
Campaign IdsCampaign Ids
Campaign Member Token NameCampaign Member Token Name
Campaign Member URL Token NameCampaign 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 AddOn Successful Add
On ErrorOn 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​

tip

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