Salesforce Campaigns Sync

Hello, I am wondering if anyone has any experience with the below and could offer some assistance.

We have a salesforce campaign for each asset (webinar, guide, form) on our website. When someone completes a form submission the salesforce campaign is hidden in a HubSpot form and stored in a field in Hubspot.
I’m hoping to build a Hubspot automation that
1. Takes the submitted ID.
2. Loops through all our Salesforce Campaign Ids.
3. Finds a match.
4. Then set the correct salesforce campaign for that contact.

Have been advised that an option could be to get your Salesforce IDs with a Webhook action - then use the output of that action in a custom coded action to say if Contact’s Campaign = the outcome of the webook then do action xyz.

It is the coded action part using either Python or Node.js etc that i am struggling with..

Hello @SHogan1, Happy Friday!

I want to share this knowledge base explaining the differences between HubSpot and Salesforce campaigns. Although both HubSpot and Salesforce have campaigns, these two objects do not correspond to each other.

Also, I found a similar post here where @HFisher7 explained more about it."

The HubSpot and Salesforce integration will also create a contact property called ‘Salesforce campaign ID.’ The Salesforce Campaign ID field will sync to their HubSpot contact record if a Salesforce lead or contact is associated with a Salesforce campaign. This property could then be used to segment contacts in HubSpot."

I hope this information helps.

Pam

Thank you!! It is the code issue where we want to connect the values in the ‘Recent SF Campaign’ field (which is from a form fill on our website) to the salesforce campaign ID where I am having difficulty!

You probably have already found a solution but I am just coming across this post in a search.

In your case, you could map the submitted ID field through to a salesforce field on the lead/contact record, and then use a Salesforce Flow “Get Records” function to query the campagin IDs for a match. Then use the “Create Record” function to create a campaign member record. Remember to include the campaign ID, lead/contact ID and the member status you’d like to set in the create operation.

What you want is doable with a custom-coded action that calls SF’s REST API to upsert a CampaignMember using the stored Campaign ID. If you’d rather skip writing/maintaining that code, a low‑code option like Skyvia can read the ID from HubSpot and map contacts to the matching Salesforce campaign automatically.