Workflow using Date property, possibly might need to be coded
SOLVE
I have a use case workflow that I need help with. What needs to happen is when a record gets created the date property needs to have the first every record date there instead of having the new record date created on that property.
An example, So if a contact -- we'll call them Raj -- has multiple Volunteer Hour records, you want "First Volunteer Date" to show the date of the first Volunteer Hour record associated with Raj?
Apologies for the delayed response, I’ve been on leave.
So as far as I understand it, you’ve got a custom object called ‘Volunteer Hours’ which is associated with the relevant contact. Then you’ve got a property on the contact record called ‘First volunteer date’ which you want to copy the ‘start date’ to for only the very first ‘Volunteer Hours’ custom object associated with that contact. Is this correct?
If so, I think this could be achieved very simply by just adding an additional enrolment criteria:
‘First Volunteer Date’ is not known
This will not solve the issue of backdating data however, it will only work with any future volunteers.
If you’re looking to backdate the data, you could approach it one of two ways:
Export all of your data, manipulate it manually and import it. Then you could just turn your workflow on and it should all work fine.
Create a contact-based workflow to handle all backdated data, run it for all relevant contacts and turn it off. Then turn on the workflow you have now with the additional enrolment criteria.
If you go with option 2 there will be some custom code required. Do you have operations hub?
If you do, my recommendation would be to set up a contact-based workflow triggered by contacts with an associated ‘volunteer hours’ object.
Then add a custom code workflow step which utilises the ‘Search’ endpoint for the custom object api (https://developers.hubspot.com/docs/api/crm/crm-custom-objects). You would filter by the contact association, sort by the create date of the custom object record (ascending) and return only 1 result (limit:1).
This can return the create date for the first volunteer hour custom object record associated with that contact. Which you can then copy to your contact record.
If you need some further guidance on the custom code part, I’m happy to help. But thought I’d better check you have that functionality in your account first.
I should note, the above suggestions assume that there is only one contact associated with a volunteer hours object record. We may need to take a slightly different approach if that is not the case.
I hope this helps, and do let me know if you need any further guidance.
Apologies for the delayed response, I’ve been on leave.
So as far as I understand it, you’ve got a custom object called ‘Volunteer Hours’ which is associated with the relevant contact. Then you’ve got a property on the contact record called ‘First volunteer date’ which you want to copy the ‘start date’ to for only the very first ‘Volunteer Hours’ custom object associated with that contact. Is this correct?
If so, I think this could be achieved very simply by just adding an additional enrolment criteria:
‘First Volunteer Date’ is not known
This will not solve the issue of backdating data however, it will only work with any future volunteers.
If you’re looking to backdate the data, you could approach it one of two ways:
Export all of your data, manipulate it manually and import it. Then you could just turn your workflow on and it should all work fine.
Create a contact-based workflow to handle all backdated data, run it for all relevant contacts and turn it off. Then turn on the workflow you have now with the additional enrolment criteria.
If you go with option 2 there will be some custom code required. Do you have operations hub?
If you do, my recommendation would be to set up a contact-based workflow triggered by contacts with an associated ‘volunteer hours’ object.
Then add a custom code workflow step which utilises the ‘Search’ endpoint for the custom object api (https://developers.hubspot.com/docs/api/crm/crm-custom-objects). You would filter by the contact association, sort by the create date of the custom object record (ascending) and return only 1 result (limit:1).
This can return the create date for the first volunteer hour custom object record associated with that contact. Which you can then copy to your contact record.
If you need some further guidance on the custom code part, I’m happy to help. But thought I’d better check you have that functionality in your account first.
I should note, the above suggestions assume that there is only one contact associated with a volunteer hours object record. We may need to take a slightly different approach if that is not the case.
I hope this helps, and do let me know if you need any further guidance.