# Custom Workflow

**URL:** <https://community.hubspot.com/t/custom-workflow/83458>\
**Category:** Lists, Lead Scoring & Workflows\
**Tags:** workflows\
**Created:** [June 15, 2023, 7:24am UTC](https://community.hubspot.com/t/custom-workflow/83458 "2023-06-15T07:24:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EConsulting](https://avatars.discourse-cdn.com/v4/letter/e/dbc845/32.png) [@EConsulting](https://community.hubspot.com/u/EConsulting)\
**Post date:** [June 15, 2023, 7:24am UTC](https://community.hubspot.com/t/custom-workflow/83458/1 "2023-06-15T07:24:46Z")

</div>

Is there a way to differentiate between the earliest and latest record date using a workflow.  
not sure if it’s possible to do this, but let me know.  
In our use case, we have 2 custom properties that need to return a date value for first volunteer date and last volunteer date. Down below we have an example of our workflow, but gave us an error

 ![Screenshot 2023-06-14 at 11.28.52 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/1/166f206f34f948a16d61cc1a018bad16f200368b.png)

---

<div class="post-metadata">

**Author:** ![karstenkoehler](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/karstenkoehler/32/68554_2.png) [@karstenkoehler](https://community.hubspot.com/u/karstenkoehler)\
**Post date:** [June 15, 2023, 7:26am UTC](https://community.hubspot.com/t/custom-workflow/83458/2 "2023-06-15T07:26:00Z")

</div>

Hi @EConsulting,

Not out of the box, no. This would require Operations Hub Professional and custom code actions: [Workflows | Custom Code Actions - HubSpot docs](https://developers.hubspot.com/docs/api/workflows/custom-code-actions)

Best regards!

---

<div class="post-metadata">

**Author:** ![EConsulting](https://avatars.discourse-cdn.com/v4/letter/e/dbc845/32.png) [@EConsulting](https://community.hubspot.com/u/EConsulting)\
**Post date:** [June 15, 2023, 8:27pm UTC](https://community.hubspot.com/t/custom-workflow/83458/3 "2023-06-15T20:27:44Z")

</div>

how can I make the custom code that will retrieve the start date as the first volunteer date instead of the most recent date?

---

<div class="post-metadata">

**Author:** ![karstenkoehler](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/karstenkoehler/32/68554_2.png) [@karstenkoehler](https://community.hubspot.com/u/karstenkoehler)\
**Post date:** [June 16, 2023, 4:15am UTC](https://community.hubspot.com/t/custom-workflow/83458/4 "2023-06-16T04:15:46Z")

</div>

Hi @EConsulting,

You would have to work with a developer and follow this documentation: [Workflows | Custom Code Actions - HubSpot docs](https://developers.hubspot.com/docs/api/workflows/custom-code-actions)

Writing this code is beyond the scope of an answer in a community.

As a starting point, you can find examples of custom code in this library: [Data Hub Use Case Library](https://www.hubspot.com/programmable-automation-use-cases)

Best regards

---

<div class="post-metadata">

**Author:** ![franksteiner79](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/franksteiner79/32/34443_2.png) [@franksteiner79](https://community.hubspot.com/u/franksteiner79)\
**Post date:** [June 15, 2023, 7:31am UTC](https://community.hubspot.com/t/custom-workflow/83458/5 "2023-06-15T07:31:39Z")

</div>

Hi @EConsulting

Can you expand a bit on your use case?

Is the workflow a contact WF or Deal WF? I am asking because of the “for associated contacts labelled” which would indicate it isn’t a contact WF. What error are you getting?

How and where are you capturing those volunteer dates? How often could I volunteer?

My initial thought, without knowing all the context:

- The WF should check if First Volunteer Date “is known”
- If it is, what should happen then? Copy into “Last volunteer date”?
- If it isn’t we copy the date value into First Volunteer Date

Thanks

Frank
