HubSpot: Count the number of updates to custom field

Jez D
Jez D
Jun 20 · 2 min read

My use case:
When users login to a desktop app, the app checks in with our servers and logs the activity. I need the latest login activity to be recorded in HubSpot. However, in HubSpot, I also need to see a count of how many times the user has logged in. This count could be in 100s or 1000s, so just viewing the property history in HubSpot would not be practicable.

The solution:
1. I created a custom contact property of type datepicker. This property is . updated by my serverless application, using the HubSpot update_by_email api endpoint, whenever the user logs in (we only need to see the date).

2. I created another custom property of type text, called last_login_time. This property is also updated by my serverless application, using the HubSpot update_by_email api endpoint. Whenever the user logs in, my serverless application sends the current time to it.

3. I created another custom field, this one is type number, called login_count

4. Next, I created a HubSpot workflow, from scratch, called “increment login”

5. I set the trigger as last_login_time is known

6. For the action, I selected “increase contact property value”

7. In the next form, I choose the contact property (login_count) and set the numerical value as 1 (the value to increment by).

8. Click on Review, select “yes, enroll existing contacts”
In the re-enrollment section, click edit, the select both options under “allow contacts… … to re-enroll”

9. Click done and you are done.

Please note, there seems to be a few seconds latency before the count field is actually updated.

Jez D

Written by

Jez D

Cloud Computing Professional & Certified AWS Architect

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade