Very new to make.com, creating my first scenario. I need to connect a Google Form x Salesforce to do the following:
- Create a new contact record in Salesforce OR Update any existing contacts if they already exist
- Create a new Custom Object record (called ‘Sessions’ in our Salesforce platform)
- Create a new Opportunity record (renamed ‘Income’ in our platform)
- Create a new Organisation record in Salesforce OR update an existing organisation record
I can see a template for creating a new record, or to update an existing one, but is there way to get a scenario that does both, plus the other things I need to do below?
I’ve already created the scenario that creates a new record, tested it and it seems to be working, although it returned an error on the test, from Salesforce, saying it would have created a duplicate - this is the kind of scenario I want to avoid.
Do I need multiple scenarios that do all of the above, or can I create one scenario with different branches?
Thanks for any advice/help that people can offer!
Laurence @ Solutions Not Sides
Hi Laurence, welcome to Make and the Make Community!
Everything you’re suggesting is possible in Make.
On your first point, there are two ways of solving this. You could search for the Contact and then use a Router to split the execution path depending on whether it’s found or not - here’s a similar example using Zoho CRM:
An Update operation won’t create a missing record, and a Create operation will throw an error if the record already exists. So we need two execution paths.
Notice that you have the same list of actions on each path following after the create/update modules. That duplication isn’t great even on just two branches and two following actions – imagine if you had 3 or more branches, and a long string of actions on each. How maintainable is that? What’s the chance of updating one branch and getting something wrong on another? It also massively increases your testing conditions.
Make provides for error handling, which can come in handy here – see here for details. Remember that the Create operation will throw an error if the record already exists? We can make use of that.
In the example above, we just go ahead and create the record based on the details in the Google Form. If the record already exists, the module will throw and error and follow the lower error handler route. There, we find the existing object and update it. But how do we get back to the upper route?
That’s where the magic comes in. The “Resume” error handler tells Make to resume processing after the failed module, using different outputs to replace the missing outputs of the failed module. You get to specify where those missing outputs come from, as in the example below:
If all of the operations you detailed on the last three bullet points are to follow on from creating/updating the Contact record, then you’d just add them to the upper path in the last scenario image. You can apply the same create/update error handling logic to each of those as well if need be.
Thank you so much for the detailed and thorough response. I’ll take a look at implementing this tomorrow and if I encounter any issues, I’ll bring them here. Thank you again!
2 posts were split to a new topic: Updating fields in Salesforce