Change date field to empty, Bulk API

Steven_French
Level 1

Change date field to empty, Bulk API

Hi there,

I'm currently using the Bulk Import API to upload a CSV of leads.

We have lead records with values in some custom date fields. However I cannot seem to set them to null using the bulk api.

My CSV could look like this:

id, customDateField
"1234", NULL

This:

id, customDateField
"1234", ""

Or even this:

id, customDateField
"1234", " "

And still the field refuses to change! What is the expected field value to set a date to null?!

Could someone please help.


Regards,Stevne

Tags (2)
7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Change date field to empty, Bulk API

NULL but not with that extra space.

Chris_Morris1
Level 4

Re: Change date field to empty, Bulk API

So, like this?

"1234",NULL

I'm having the same issue - thank you!

SanfordWhiteman
Level 10 - Community Moderator

Re: Change date field to empty, Bulk API

Yes.

Gaoan_Guo
Level 1

Re: Change date field to empty, Bulk API

you should use "null" as a string 

SanfordWhiteman
Level 10 - Community Moderator

Re: Change date field to empty, Bulk API

NULL does not need to be quoted.

All fields in a CSV are text (it's a text format).

Double-quoted

  ...,"NULL",...‍‍

is no different from

  ...,NULL,....

in this context.

Quoting is used to allow fields to contain double quotes, line breaks, and/or commas, i.e. to avoid delimiter collision.

Question's already answered, anyway.

Gaoan_Guo
Level 1

Re: Change date field to empty, Bulk API

I retried several cases in my local, the time I found NULL wasn't working is in early 2019, looks marketo has fixed this problem.

it's true we can use NULL to clear the field

Also using "null"(quote or unquote no difference) is still working and can set the value to blank,

SanfordWhiteman
Level 10 - Community Moderator

Re: Change date field to empty, Bulk API

Marketo uses -- and has always used -- the 4-character string NULL to represent the empty value in many places, including in forms and flows.