Created
October 10, 2016 12:28
-
-
Save scott-kloud/f77623117e7668cc894615d49cfade72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 1.0 | |
%output application/json | |
%namespace ns0 http://ns0.com.au/api/invoices | |
--- | |
( | |
payload.ns0#invoiceResponse.ns0#invoices.*ns0#invoice map ((invoice , indexOfInvoice) -> { | |
invoiceNo: indexOfInvoice, | |
invoiceDate: invoice.ns0#date as :datetime as :string {format: "dd/MM/YYYY HH:mm:ss"}, | |
billingTime: invoice.ns0#billingHours | |
}) | |
) | |
when payload.ns0#invoiceResponse.ns0#invoices is :object | |
otherwise [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment