We are attempting to assign campaign members and their associated campaign statuses to campaigns within SFDC.
We're looking for the campaign member ID because this is a requirement for the API call to succeed. Sort of a chicken or egg dilemma. How do we send a campaign member ID for a record that is not associated with the SFDC campaign yet?
This leads me to believe this is two-step process where an ID gets generated first and then we can make the update. Anyone have experience they can share?
Solved! Go to Solution.
The crazy part, it would seem, is that the upsert function for campaign members requires this campaign member ID. So I don't understand how that is ever usable for a new campaign member.
The upsert() function does require the CM ID for records that already exist, which means it functions somewhat differently from, say,a MERGE insert in SQL Server.
Since you need to know which people you’ll be updating in advance, it’s not an intelligent upsert, but more of a “bundle insert calls and update calls in one request” feature.
You can’t avoid querying for existing Campaign Members to get their IDs.
As you seem to have already figured out, this is a pretty strange request!
You can’t know the Campaign Member ID before someone is a member of a Campaign — that’s impossible. The Campaign Member is a junction object. The creation of that object is the only way a person is added to a Campaign!
So let’s take a step back. We may have a significant XY Problem. What are the requirements you’re trying to meet? Please be as detailed as possible. Don’t think about “what is the Campaign Member ID” but about your true goals.
Hey Sanford,
So desired outcomes would be for a Marketo record that is synced to SFDC (custom integration):
We have data for ContactID, CampaignID, and various attributes, but are missing this "Id" which for this sobject seems to be the campaign member ID. Chicken and egg, no Id exists for an insert.
Currently we are attempting to do all of this in a single job. My assumption is that this must be a two-part process where we
The crazy part, it would seem, is that the upsert function for campaign members requires this campaign member ID. So I don't understand how that is ever usable for a new campaign member.
The crazy part, it would seem, is that the upsert function for campaign members requires this campaign member ID. So I don't understand how that is ever usable for a new campaign member.
The upsert() function does require the CM ID for records that already exist, which means it functions somewhat differently from, say,a MERGE insert in SQL Server.
Since you need to know which people you’ll be updating in advance, it’s not an intelligent upsert, but more of a “bundle insert calls and update calls in one request” feature.
You can’t avoid querying for existing Campaign Members to get their IDs.