Hi
I have a property ‘Date of next step’ type date picker added to the contact definition.
I created a workflow in HubSpot. During the workflow runs, I want to set the ‘Date of next step’ set to a value calculated in a custom code section. The calculation of the date is simple, it ist the date of the actual run with 30 days added. First I tried to calculate and set the date like other properties in an ‘Edit record’ block, but this is not possible. To set the value from a custom code block isn’t an option either.
What is the best way to do this?
Thanks
Hi @baernhardj,
I’d say there’s a simpler way to do this, without custom code, less risk of error and bypassing the issue entirely: a calculation property. Create calculation and rollup properties
Create a custom equation, with type date, then add the equivalent of 30 days in milliseconds to your start date.
Best regards!
Hi Karsten
Thanks for your reply.
If I got you right, then I should create a second calculated date field based on the first one:
So I can set the first one and calculate the second one?
In the workflow then I have to set the first one to the date of the workflow run and the second one is calculated.
Is that the process you have in mind?
The reason of the property is to trigger a workflow in 30 days and do some steps.
Probably then it will be better to crate the worflow trigger based on a list, where the date is 30 days in the past…
Thanks and best regards
Bernhard
@baernhardj let me know if we can switch to German.
If you want to add or remove days from a date, a calculation property is sufficient, for example:
Date 2 = Date 1 + 30 days
No need for an additional workflow.
Lieber Karsten
Deutsch ist kein Problem.
Ich habe einen Workflow in dem ein Kontakt bearbeitet wird. Im Workflow selbst soll der zuständige HubSpot Benutzer informiert werden.
30 Tage nach der Abarbeitung dieses Workflows, soll mit diesem Kontakt ein folge Workflow gestartet werden. Dazu das Datum (für den Start des folge Workflows) gespeichert werden.
Im ersten, wie im zweiten Workflow werden noch weitere Steps / Checks durchlaufen. Es kann sein, dass je nach Konstellation der Kontaktfelder, der zweite Workflow nach 30 Tagen gar nicht gestartet werden muss. Dann wäre das Datum auch nicht gesetzt.
Ich hoffe, dass dies mein Anliegen klarer verständlich macht.
Vielen Dank
Bernhard
@baernhardj die beste Herangehensweise wäre m.E. trotzdem eine Berechnungseigenschaft, da die – anders als Workflows – keine Aussetzer haben kann und – anders als Custom Code – nicht fehleranfällig ist.
Eine Berechnungseigenschaft würde auch dynamisch das Datum verschieben, sollte sich das Startdatum ändern. Per If-Statement kannst du außerdem festlegen, dass es nur unter bestimmten Bedingungen berechnet werden soll.
Per Custom Code geht natürlich auch – aber per Berechnungseigenschaft ist es meiner Meinung nach deutlich robuster.
@karstenkoehler
Danke für deinen Input, den ich gerne betrachte.
Du bist für ein berechnetes Feld. Das gefällt mir eigentlich schon.
Deine Berechnung wäre ja: Date 2 = Date 1 + 30 days
Date 2 ist ein Property von dem Kontakt, wenn ich dich richtig verstehe. Das Date 1 ist der Zeitpunkt an dem der Workflow ausgeführt wird. Dieses muss ich ja während der Abarbeitung vom Workflow setzen, sonst kenn ich das nicht. Der Workflow läuft zu einem unbekannten Zeitpunkt ab (also wenn der Trigger erfüllt ist, in meinem Falle ist dies sogar ein Webhook inizierter Workflow).
Zum If Statement: Hier ist dies abhängig von momentanen Gegebenheiten, während dem Ablauf des Workflows. z.B. der Kontakt wird von einer Firma getrennt und der Kontakt ist immer noch mit einer Firma verbunden, die die gleiche Zuständige Person hat, dann muss ich diese nicht informieren und es gibt keine Folgeaktivität in 30 Tagen. Somit kann ich das Datum für die Folgeaktivität leer lassen.
Ich denke, dass ich dies nicht in ein Calculated field einbauen kann.
Vielen Dank
Bernhard
Sorry, but I found the solution. I saw only the Date Picker below and I overlooked, that the ‘Insert data’ window was shown on the right side with the possibility to set the date as result of the custom action…
Thanks for the help.
Best regards
Bernhard