I am looking for some ideas on how to solve an issue we're experiencing with a workflow. If the enrollment criteria is met, the first step in the workflow creates a new record in a custom object for that particular contact. The workflow will then copy several contact properties that were updated from Salesforce. The copy steps will update the new record in the custom object with the latest values of those contact properties. However, the issue is that if that contact already has existing records in the custom object, the copy process will also step on those existing records.
I am not sure how to prevent the existing records from getting stepped on. Do we need a different approach to the workflow?
First of all, thanks for the willingness to help out and offer suggestions. I truly appreciate it.
Let me give some background on the process so that you can have a better understanding of how it works.
Contact (new or existing) fills out a test questionaire answering various questions with a an answer of 1-10. The contact info and test answers are then updated to Salesforces where calculations are conducted and a score is determined for 5 categories. The scores are then updated back to Hubspot for that contact. The custom object is meant to store all of the scores for a contact each time they take the test. The scores in the custom object are displayed in charts on a dashboard website page that the contact can log into. The dashboard will only show the scores for the contact logged in and contains other information as well.
The workflow was created to copy those test scores (contact properties) to the custom object each time they are updated from Salesforce. The workflow works correctly when the contact is taking the test for the first time. However, if the contact already has existing scores in the custom object, the workflow will step on them when copying the latest scores in.
The If/then branch seems like the logical solution where we could have some sort of data validation before executing the copy steps. However, it doesn't appear that I can validate against the custom object. See attached screenshot of my options-
As I mentioned previously, the first step in the workflow, if the enrollment criteria is met, is creating a new record for the contact in the custom object. The new record has "0" for the 5 test scores which would then get stepped on with the real scores by the copy steps.
Thanks for the suggestion. I started a workflow based on the custom object, however, when I start building it out, I am not able to access the contact properties for the copy steps. It will only allow me to copy from properties in the custom object. Maybe I am not setting it up correctly initially. I will review it again.
Hi, @tmcmillan99👋 Thanks for the great question. Workflow options are always an interesting challenge.
Thanks for the suggestion @weiliang_lee. I appreciate the simplicity. One related follow-up question for @tmcmillan99 — if the first property checked using an if/then branch is known, is it safe to assume all are known? Or would it need to always check against each of the properties it needs to copy every time?
I ask because if one property is known, is it safe to assume all are known? This would require only one branch.
Thanks for the suggestion. I had originally thought about the if/then branch and added a checkbox to the custom object in order to show a record as "processed". The idea was to only copy to the custom object if the checkbox is not checked or is "not processed". However, when I go to set up the if branch, none of the custom object properties are available to use.
Your enrol criteria is based on a Contact being created from SFDC right?
Then you would have a matching Custom Object, in which you copy the values of those properties over from the Contact object.
I don't quite get the use case - what is purpose of your Custom Object? Perhaps if we look at your original intention, we could put our heads together to find out if this approach is the best way.
It seems that you could use the If/Then branch action. From here you could set a filter that checks if "your custom object's property is unknown" - which then leads to your step of copying the contract property over.
Hi @tmcmillan99 As you have mentioned that you are creating new record in custom objects, so how the property values on that custom ojecect can be preoccupied as its a new record.
Please correct me if I have wrongly interpretated your request.