Hello,
I am trying to implement a very basic scenario:
- receive a web-hook
- search for a Hubspot contact with email equal to the parameter received by webhook
- if no contact has been found, then create one
- using the ID from either step #2 or #3, check if there is a deal associated with it; create a new deal if it does not exist
- Post a note into the deal with ID from the step #4
I found a very similar question in this post - but the solution there suggests to create two separate branches for each condition (object exists or does not), which will result in duplication of the code and will make further maintenance more difficult. I should be able to say something like “use object ID from the bundle produced by the module A if available; otherwise use ID from the bundle from module B” - but cannot figure it out. I thought “aggregator” would do the trick, but I cannot connect it to operations like “create a contact”
I have to be missing something very obvious - please help!
1 Like
I found the “set variable” module and was excited, since it seemed to be the exact thing I would use in “normal” programming (set it with the value returned by the search or by “create new” operation), but alas! - I cannot connect the other “set” module to the “search for deals”
1 Like
And here is the blueprint
blueprint.json (304.0 KB)
1 Like
Hey @truemetal
You just need some tweaks. Adding set variable on “create a contact” module is fine. Now, add a “get variable” on your next route and type the same name you have typed in set variable. Now in your next module, map like
{{ifempty(variable_from_webhook;variable_from_get_variable)}}
Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation
1 Like
Thanks for the advice! But I still cannot “join” two routes - the one where the contact exists and we just use its ID - and the one where the contact has to be created…
1 Like
You don’t have to join the routes @truemetal They are connected now using set and get variable. Using get variable, you are calling the variable on another route.
Please note, Set variable should be on the route where the contact is created and get variable should be where the contact already exist.
Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation
Still does not work I have added the “get variable” as you suggested, but I cannot seem to pick up the value of the “get variable” in subsequent modules, it only shows the values from webhook and the “search” module
1 Like
@truemetal
Did you type the variable name inside “get variable” module??? If yes, click on cancel of hubspot module and then open again.
Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation
Yes, I did.
And strangely enough I can see that variable as on option when setting a filter
Apparently it does not work when I “inserted” the “get variable” in the flow (dragged it to the existing connection); had to clone the hubspot module and attach it to “get variable” - then it appeared!
thanks!
1 Like
Is there a way to see a more detailed log, specifically what was populated into “Object ID”?
1 Like
@truemetal This is because error in function. in functions(), always use semicolon “;” instead of “,” like in below image.
Regards,
Msquare Automation - Platinum Partner of Make
@Msquare_Automation
1 Like
It finally works! Thanks a lot!
1 Like
Hi @truemetal
Glad to know that your issue is resolved now.We would really appreciate if you mark the answer as solution if it helped you. This will keep the community healthy and organized.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation