Hi,
I got the company next activity date from API. I thought the data type is datetime or date, but i got empty string for few. Is it expected? Can we get null istead of “” this empty string.
Thanks in advance
Hey @Arunesh,
I’m unable to replicate what you are seeing. For instance when I retreive a particular company from the CRM using GET /crm/v3/objects/company/{companyId} a null value is returned for the “Next Activity Date” property. See my request below:
GET https://api.hubapi.com/crm/v3/objects/company/8200747722?properties=notes_next_activity_date
RESPONSE
{
"id": "8200747722",
"properties": {
"createdate": "2023-08-07T08:12:56.043Z",
"hs_lastmodifieddate": "2023-08-16T14:33:56.468Z",
"hs_object_id": "8200747722",
"notes_next_activity_date": null
},
"createdAt": "2023-08-07T08:12:56.043Z",
"updatedAt": "2023-08-16T14:33:56.468Z",
"archived": false
}
I am retrieveing “notes_next_activity_date” which is defined as “Date of the next upcoming scheduled sales activity for this company record.”. See below:
"name": "notes_next_activity_date",
"label": "Next Activity Date",
"type": "datetime",
"fieldType": "date",
"description": "Date of the next upcoming scheduled sales activity for this company record.",
"groupName": "company_activity"
In the UI when I check the company I see this:
Questions for you:
- Are you using the endpoint above?
- Which property are you trying to retrieve - is it the “notes_next_activity_date” property?
- Can you share any more information about your request
Hi @jackcoldrick
I got the empty string when the activity was deleted. Say I create an activity for an upcoming follow up and delete that. While retrieving the data for next activity I get the empty string
Hey @Arunesh
I understand, I am seeing the same. See below:
1) Without activity created
I can see “notes_next_activity_date” is null.
GET https://api.hubapi.com/crm/v3/objects/company/8200747722?properties=notes_next_activity_date
{
"id": "8200747722",
"properties": {
"createdate": "2023-08-07T08:12:56.043Z",
"hs_lastmodifieddate": "2023-08-16T14:33:56.468Z",
"hs_object_id": "8200747722",
"notes_next_activity_date": null
},
"createdAt": "2023-08-07T08:12:56.043Z",
"updatedAt": "2023-08-16T14:33:56.468Z",
"archived": false
}
2) When activity created
I see “notes_next_activity_date” has timestamp.
GET https://api.hubapi.com/crm/v3/objects/company/8200747722?properties=notes_next_activity_date
{
"id": "8200747722",
"properties": {
"createdate": "2023-08-07T08:12:56.043Z",
"hs_lastmodifieddate": "2023-08-18T17:18:30.546Z",
"hs_object_id": "8200747722",
"notes_next_activity_date": "2023-08-23T07:00:00Z"
},
"createdAt": "2023-08-07T08:12:56.043Z",
"updatedAt": "2023-08-18T17:18:30.546Z",
"archived": false
}
3) When activity deleted
I see “notes_next_activity_date” is an empty string.
GET https://api.hubapi.com/crm/v3/objects/company/8200747722?properties=notes_next_activity_date
{
"id": "8200747722",
"properties": {
"createdate": "2023-08-07T08:12:56.043Z",
"hs_lastmodifieddate": "2023-08-18T17:19:20.295Z",
"hs_object_id": "8200747722",
"notes_next_activity_date": ""
},
"createdAt": "2023-08-07T08:12:56.043Z",
"updatedAt": "2023-08-18T17:19:20.295Z",
"archived": false
}
I do still think this is working as designed and I’d just recommend checking the response for the presence of a falsy value i.e something that will evaluate to false (undefined, null, NaN, 0, “”).

