Search code examples
azure-logic-appsmicrosoft-dynamicsdynamics-365azure-logic-app-standard

Chnage DateFormat in Logic apps


There is a date field in my logic app which i am getting data from finops connector. enter image description here

In JSON assigning the field. After Parsing Json and create a csv table assinging like this enter image description here

Is there a way for me to format the date using formatDateTime in any of the steps above ?

Thanks, Vivek


Solution

  • I suspect you may have an issue with null values in your array.

    You need to check every item and make sure the invoiceDate field contains a valid value.

    Something like this will help you if you don't filter them out ...

    if(equals(item()['invoiceDate'],null),'',formatDateTime(item()['invoiceDate'], 'dd.MM.yyyy'))
    

    ... but you will need to decide on the business logic with those items that do have a null invoice date.