2

I have just started using liquid mapping in Logic apps for transforming json data to text. I have to convert date in a specific format. In the json data, I have date value as 20181230T000000.000 GMT and i want to transform the date in "MMddyy" format.

I had used {{"now" | Date: "MMddyy"}} for transforming current date to specific format. But when i am using the same syntax of transforming current date in specific format it works as in following answer Date Math / Manipulation in Liquid Template Filter

But when the same syntax I am trying to utilize while picking up data from JSON, it's not working. what could be possibly wrong?

Json data example:

{
    "ItemSerialNumber" : "ItemSerialNumber",
    "ExchangeOrderNo" : "ExchangeOrderNo",
    "ShipDate" : "20181230T000000.000 GMT"
}

transformation syntax tried : {{content.ShipDate | Date: "MMddyy"}}

but it didn't worked and output came 20181230T000000.000 GMT

Esther Fan - MSFT
  • 8,276
  • 4
  • 27
  • 25
it2008018
  • 21
  • 1
  • 5

1 Answers1

0

You should use the set the date using the format directives (a full list of which can be found here

So {{ "20181230T000000.000 GMT" | date: "%m %d %y" }} outputs 12 30 18 And {{ "20181230T000000.000 GMT" | date: "%B %d %y" }} outputs December 30 18

This should also work using {{ "content.ShipDate" | date: "%m %d %y" }} outputs 12 30 18

RobbeVP
  • 379
  • 3
  • 9