CMS Development

tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Suggestions for Workflow issue

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? 

Any suggestions would be greatly appreciated.

 

Thanks,

Terry McMillan

0 Upvotes
9 Replies 9
danmoyle
Most Valuable Member | Elite Partner
Most Valuable Member | Elite Partner

Suggestions for Workflow issue

Hi Terry. I saw this on LinkedIn recently and wonder if some branching logic might help. 

workflow-copy-properties.jpg

That may spark an idea for you. 

 

Did my answer help? Please "mark as a solution" to help others find answers. Plus I really appreciate it!


Dan Moyle

HubSpot Advisor

LearningOps | Impulse Creative

emailAddress
dan@impulsecreative.com
website
https://impulsecreative.com/
tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Suggestions for Workflow issue

@weiliang_lee @danmoyle @deepikaverma 

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-

tmcmillan99_0-1669819926333.png

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,

Terry

 

0 Upvotes
deepikaverma
Guide | Partner
Guide | Partner

Suggestions for Workflow issue

Hi @tmcmillan99 
To make if then condition successful, make a custom object based wf and then perform that copy step. It will work.

I hope it helps!
Thanks!

0 Upvotes
tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Suggestions for Workflow issue

Hey @deepikaverma 

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.

 

Thanks,

Terry

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Suggestions for Workflow issue

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.

 

Hey, @deepikaverma @danmoyle, do you have any additional light to shine here?

 

Thank you very much! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

tmcmillan99
Contributor | Elite Partner
Contributor | Elite Partner

Suggestions for Workflow issue

@Jaycee_Lewis @weiliang_lee 

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. 

Is that a possible custom object settings issue?

 

Thanks,

Terry

0 Upvotes
weiliang_lee
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Suggestions for Workflow issue

Hi @tmcmillan99 

Help me understand a little more about the flow:

  • 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.

 

Cheers
WL

weiliang_lee
Top Contributor | Diamond Partner
Top Contributor | Diamond Partner

Suggestions for Workflow issue

Hi,

 

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.

 

weiliang_lee_0-1669702673649.png

 

Cheers

WL

 

0 Upvotes
deepikaverma
Guide | Partner
Guide | Partner

Suggestions for Workflow issue

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.

Thanks!


0 Upvotes