Expand my Community achievements bar.

SOLVED

Source date transformation to timestamp

Avatar

Community Advisor

Hi

I am trying to convert a date from the source system to AEP timestamp in Event dataset. The source contains data like 2022-11-21T05:00:00 with a T in between date and time. I have added a data prep function date(source_date,"yyyy-MM-ddTHH:mm:ss") to convert it into Timestamp. After doing this mapping i see No error and in preview data everything looks ok. However as soon as i start the import process the import process fails and i can see error in the monitoring section "Error transforming data for required destination path timestamp. Details: com.adobe.aep.aexl.jexl.AexlScriptEngine$AepJexlEngine.parse@1:5 Unable to resolve function/method 'date' with the specified parameters. Please verify the function name, parameter count and parameter type." I am not sure why this error is showing up when in preview data everything looks good

 

Can someone help me how can i proceed now?

 

I also tried to update the source_date using substr and replacestr functions but it looks like you can't use this function inside date.

 

Many thanks!

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

The timestamp field in AEP requires an ISO date format timestamp (https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).  YYYY-MM-DDTHH:mm:ssZ.  I ensure your date function uses date(DATE, FORMAT, DEFAULT_DATE) or date(DATE, FORMAT) converts the date string into an an ISO 8601 format.

View solution in original post

2 Replies

Avatar

Moderator

Hi @arpan-garg 

 

I think you have some values in the file which doesn't follow the format "yyyy-MM-ddTHH:mm:ss" or you may have values which follows single digit parameter [Ex : 2022-1-2T05:00:00 --> date(source_date,"yyyy-M-dTHH:mm:ss")]. I would suggest you can use partial ingestion method or try to insert single record to confirm logic wise it's correct but issue is within the data. 

 

Regards,

Arijit Ghosh

Avatar

Correct answer by
Community Advisor

The timestamp field in AEP requires an ISO date format timestamp (https://datatracker.ietf.org/doc/html/rfc3339#section-5.6).  YYYY-MM-DDTHH:mm:ssZ.  I ensure your date function uses date(DATE, FORMAT, DEFAULT_DATE) or date(DATE, FORMAT) converts the date string into an an ISO 8601 format.