Datetime field type in custom activity | Community
Skip to main content
Level 2
July 27, 2020
Solved

Datetime field type in custom activity

  • July 27, 2020
  • 1 reply
  • 4207 views

Hi everyone!


I have a question about a datetime field on a custom activity. I would like to push a custom activity but I'm facing a problem: what must be the type of a datetime?

I've tried a lot of things but nothing works:

 

"2020-07-16T10:51:58-04:00" (iso 8601, suggested here: https://developers.marketo.com/rest-api/lead-database/fields/field-types/)

"2020-07-16T10:51Z"

"2020-07-16T10:51:58Z"

"07/16/2020 10:51:58" (suggested here: https://nation.marketo.com/t5/Knowledgebase/Marketo-Field-Limits-by-Field-Type/ta-p/251613)

Here is the return error I got from the API:

 

{ "requestId"=>"ab31#173907cf501", "result"=> [ { "status"=>"skipped", "errors"=> [ { "code"=>"1003", "message"=>"Invalid attribute 'interactionDate'" } ] } ], "success"=>true }

 

 

I checked in the admin part, but the field is called interactionDate (I tested with other names and it doesn't change anything, I still have the same error)

 

Does someone have an idea?

 

Thank you all!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by alexis_lewalle

Hello again,

 

After looking on the internet, I finally found my problem... This post helps me: post

My problem wasn't related to the "datetime" format... but the filed name that I used when I did the call!
I don't understand why they called it "apiName" and we have to use the "name"??

 

In my case, I used "interactionDate" (apiName) instead of "Interaction Date" (name)...
When I set "Interaction Date" with this DateTime value "
2015-07-20T12:30:00-08:00", it works like a charm!

But it will remain a mystery to me...

 

Again, thank you for your help! Have a good one

1 reply

Tracey_Bartz1
Level 4
August 4, 2020

This might be a silly question but are you sure the field type is datetime and not just date?

Darshil_Shah1
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 4, 2020

Yes Tracey's concern is right. This happened to me few weeks back, I was setting the attribute to datetime value instead of date only value and it was throwing an error, as soon I used the Date only format (YYYY-MM-DD) it worked like charm.