Best answer

Can Asana accept Hubspot deal start and end dates in custom fields? Custom fields work if dates are left blank


Userlevel 1

I have an Asana project that has 2 custom Date fields.

I want to put the HUBSPOT DEAL START DATE in one 

and the HUBSPOT DEAL END DATE in the other.

but I can’t get it to work?

Does anyone know how to get Asana to read this / accept these dates

(currently formatting it into DD/MM/YY) 

 Asana isn’t accepting the input, which also causes it to not update the other custom fields

(i.e. the other custom fields work if i leave the dates blank)

 

icon

Best answer by Troy Tessalone 2 June 2023, 04:03

View original

15 replies

Userlevel 7
Badge +6

Hi there @Mark J,

Before we dive deeper, it's worth checking if Asana has specific requirements for date formats that need to match the format in your Asana app. Could you kindly confirm whether the date format you're trying to send matches the one specified in your Asana app?

Please keep us posted! 😊

Userlevel 1

Great Question @ken.a 

I was thinking the same.. that it might be the date format.

All I could find online was that it only accepts MM-DD-YYYY

but I tried that and it still wouldn’t work.

Userlevel 7
Badge +14

Hi @Mark J 

Good question.

Generally app APIs use this format for dates: YYYY-MM-DD

Give that a try and let us know.

Userlevel 1

Thanks for responding Tony appreciate your help.

The Default date format coming out of hubspot looks to already be in YYYY-MM-DD

and unfortunately that doesn’t work.

 

Userlevel 7
Badge +14

@Mark J

Try passing in this value format: {“date”:“YYYY-MM-DD”}

Replace YYYY-MM-DD with your mapped variable.

 

 

For reference, check out the Asana help article: https://forum.asana.com/t/read-write-date-custom-field/194507 (snapshot below)

If the above doesn’t work, then you may have to use this Zap action: Asana - API Request

Asana API: https://developers.asana.com/reference/updatetask

 

If you need help, consider hiring a Certified Zapier Expert: https://zapier.com/experts/automation-ace

 

Wanted to share since I hadn’t seen this anywhere yet. For the new Date custom field type, when reading a date value via the API you receive
“date_value”: {
“date”: “2022-08-18”,
“date_time”: null
}
For a date. If the value was a datetime, then you would have “date”:null and “date_time” would have an appropriate value.

When updating a custom field in a task, instead of simply specifying the value for the field as “2022-08-18” like you might for a text field, you have to pass an object with either (but not both) a “date” key or a “date_time” key. These dates then follow the same formatting as due_on and due_at.

So to update a date custom field, the call would look something like:
“custom_fields”: {
“4578152156”: {“date”:“2022-08-18”}
},

I didn’t see this in the API docs yet and I didn’t find it when trying to search the forums.

If you use the wrong format, the API returns an error saying your object isn’t formatted correctly or that it was expecting an object, but it took a little trial and error to get it right. Hope this helps someone else.

Userlevel 1

thanks Troy, tried your suggestion. and once again all custom fields are blank.

 

 

{“date”:“1. Deal informatio…: Deal End Date:2023-06-25”}

and

“date_value”: { “date”: “1. Deal informatio…: Deal End Date:2023-06-25”, “date_time”: null }

I made a task on the project, entered the dates and then added a find task step to the zap to test the results

and it looks like yes the date format is   YYYY-MM-DD (SEE BELOW)

I even tried reformatting to the display value - that didn’t work

and then tried using another existing property value with that same formatting - again no avail

 

Haven’t used API calls before. so thanks for posting the links. (appreciated) 

 

 

copy and past of the find task “end date” custom property field data.

name

End Date

description

 

created_by

gid

1200509354043476

name

Sally Nicholson

resource_type

user

id

1200509354043476

display_value

2023-07-31T00:00:00.000Z

resource_subtype

date

resource_type

custom_field

date_value

date

2023-07-31

date_time

null

is_formula_field

false

is_value_read_only

false

type

date

id

1204585168369917

Userlevel 7
Badge +14

@Mark J 

Unsure if this will make a different, but try adjusting the double quotes to not be slanted, but instead straight vertical.
"
(yes there are 2 types of double quotes)

 

Userlevel 1

well I didn’t know that there was two types. 

typed it in (instead of copy and paste) and looked to be straight quotes…   no luck

even tried adding   _value  just incase that worked - NOPE

 

 

Userlevel 7
Badge +14

@Mark J 

Did you try it with “date” instead of “date_value”?

 

Userlevel 1

100% @Troy Tessalone  tired that first as you suggested

it was only when that didn’t work did I try adding in the _value ( in some vain hope 😀)

 

Userlevel 7
Badge +14

@Mark J 

You can try opening a ticket with Zapier Support to see if they can offer guidance: https://zapier.com/app/get-help

Otherwise, it’ll have to be the Asana API.

Userlevel 1

Thanks Troy.

can’t log a ticket yet. waiting on the boss to active the paid membership.

really appreciate all your help though  

Userlevel 7
Badge +14

@Mark J 

Here’s how to configure the Zap action: Asana - API Request

 

CONFIG

Method: PUT (used to update a Task)

URL: https://app.asana.com/api/1.0/tasks/TASK_ID (Replace TASK_ID with the Task ID)

Body:

{"data":{"custom_fields":{"FIELD_ID":{"date":"YYYY-MM-DD"}}}}

Replace FIELD_ID with the Custom Field ID

Replace YYYY-MM-DD with the dynamic variable.

 

 

You can use the Asana API Explorer to help you get the Custom Field ID: https://developers-legacy.asana.com/explorer

 

To do that, you’ll first need to get the Asana Workspace ID.

You can get this manually from an Asana Zap step where you select the Workspace. (see example below)

OR

You can use the Asana API Explorer: Workspaces > GET /workspaces
(make sure to select all checkboxes for Include Fields and adjust other settings as necessary)

 

 

Then you can use the Asana API Explorer to get the Workspace Custom Fields: Custom Fields > GET /workspaces/:workspace_gid/custom_fields
(make sure to select all checkboxes for Include Fields and adjust other settings as necessary)

Userlevel 1

@Troy Tessalone you absolute LEGEND.!!!!!

Followed those instructions and BOOM! start dates and end dates are now on the test task.!!

There’s no way I would have been able to figure that out on my own. 

 

massive thanks man.!!

 

 

(Didn’t need to put in a workspace Id)

Userlevel 7
Badge +9

Just wanted to pop in and mention Troy really is the 🐐.

Love seeing such an excited end to a thread and appreciate you swinging back around to let us all celebrate with you! 🎉

⚡️ Happy Zapping!

Reply