Best answer

Can Zapier create two Salesforce objects and link them together?

  • 6 February 2023
  • 3 replies
  • 177 views

Userlevel 1

I'm just evaluating Zapier, can it create two Salesforce objects and link them together?

Lets say in Salesforce I have two custom objects

Foo__c

Bar__c

and Bar__c has a lookup or master detail field Bar__c.Foo__c that links it back to Foo__c.

Using Zapier can I create the two objects and link them together?

e.g.

Create new Foo__c record

Get the ID of that new Foo__c record

Create nmew Bar__c record

Fill in Bar__c.Foo__c to point back to the Foo__c record I just created

 

Thanks

icon

Best answer by SamB 6 February 2023, 14:32

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +11

Hi @codeulike, welcome to the Community! 👋

The Create Record Salesforce app action supports custom objects so you should be able to create new records and link them together.

The Create Record action would provide the ID for the custom object record it just created. So you’d need two separate Create Record actions in the Zap. One to create the Foo__c record and one to create the Bar__c record.

In the second Create Record action that creates the new Bar__c record, you would select the ID for the new Foo__c record (from the first Create Record action) using the Custom value option. I would have thought that should be enough to link the two records together. But if not, you could always use an Update Record action to update the relevant field on the Foo__c record that was created, with the ID of the Bar__c record that was created. Again, you’d need to do that using the Custom value option.

I’d recommend reviewing our add custom values to dropdown menu fields in Zaps guide for more details on how to use custom values in Zaps. 

Hope that helps to get you started. Please do let us know how you get on with this!

Userlevel 1

Thanks, I just tried it out and it works. Brilliant. In the second Create Record action you can use the Ids from the previous ones.

 

Also: apologies if this question got posted multiple times, I kept pressing ‘create’ on the forum and it seemed to be ignoring me but evidently the question did get posted….

Userlevel 7
Badge +11

Thanks for letting us know, @codeulike. I’m so pleased that did the trick! 😁🎉

No worries about the accidental posts, we’ve removed them. Your question was caught by the Spam filter initially, so that’s why it didn’t appear at first.