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