1

I have my Java based FuelSdk working for String column types. But as soon as I try to insert a date or a boolean, the application blows up.

It looks like I need to specify the data type for the column, but I can't find any example on how do that.

I have found the questions here about date format and have confirmed that I am writing the date in the correct format.

How can I tell FuelSdk that I am inserting a Date?

  • Just to confirm, you are trying to create a new "Field" within an Existing Data Extension and can't create a column with Field Type being date or boolean? Do you have any samples of what you're attempting that isn't working for you and also what you use for the "String" column types that works successfully for you? Thanks! – Jeremy Sep 26 '14 at 18:00
  • No, the data extension has been created with a date field. I'm just trying to insert into it. – Joseph Nelson Sep 26 '14 at 18:01
  • If you already have the field created in your Data Extension and it's data type is set as "Date", you should be able to include your date like you normally would with a string type. Can you update your Question with sample code you're using and what type of errors you're seeing? What format is your date in right now? Do you have an example of this as well? Can look similar to "2014-09-25 05:42:16" – Jeremy Sep 26 '14 at 19:08
  • That's part of the silly issue. It blows up with a connection error, but it only does so when I'm inserting the date or boolean fields. I'm using final DateFormat outFormatter = new SimpleDateFormat("M/dd/yyyy h:mm aa"); to format my date, so it would look like "9/25/2014 5:24 AM". Are you suggesting I use the format you gave? – Joseph Nelson Sep 29 '14 at 12:36
2

Fuel isn't going to format your date for you, nor will ExactTarget once it receives the data. You need to provide a valid data format for the date field if you want ExactTarget to accept it. You would pass it through Fuel as a string (as you are ostensibly doing) but it needs to be in the Date format.

Acceptable Date Formats:

Date: "YYYY-MM-DD"

Date and Time: "YYYY-MM-DDThh:mm:ssZ"

(Date and Time also accepts offset times like YYYY-MM-DDThh:mm:ss+hh:mm and YYYY-MM-DDThh:mm:ss-hh:mm)

|improve this answer|||||
  • Thanks, I got this working based on Jeremy's comment. As for the booleans, I just made them strings as it wasn't worth fighting with. – Joseph Nelson Oct 7 '14 at 17:37
  • Great. '0' and '1' should work in boolean fields but changing them to strings of length 1 probably works just fine too. – Alex Finger Oct 7 '14 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.