cancel
Showing results for 
Search instead for 
Did you mean: 

Date format in sap conversational AI getting null error

07-06-2020 3:19 PM
534 views 1 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi,

I have a date in {{api_service_response.Value.body.d.results[0].InvoiceDate}} which gives me "/Date(1535673600000)/"

so i want to convert to human readable format so i am doing

{{formatDate api_service_response.Value.body.d.results[0].InvoiceDate 'YYYY-MM-DD'}} but getting "null" as output,

can you guide me

Thanks

Kishore

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

JonasB
Advisor
Advisor
0 Likes

Hi Kishore,

please make sure you use the new syntax (as used in handlebars) for accessing array elements when using scripting helpers:

The new syntax to access an element in an array is {{array.[0]}}. The old syntax {{array[0]}} is still supported for simple expressions, but cannot be used in combination with helpers and will be deprecated completely with one of the next releases.

https://help.sap.com/viewer/DRAFT/a4522a393d2b4643812b7caadfe90c18/latest/en-US/b4f08a9a66434327a405...

So in your example it should be:

{{formatDate api_service_response.Value.body.d.results.[0].InvoiceDate 'YYYY-MM-DD'}}

Regards
Jonas

Answers (0)