Rohan Shinde
Rohan Shinde

Reputation: 131

How to use equal Ignore Cases in Dataweave

I want to check equal Ignore cases in dataweave

%dw 1.0
%output application/xml
--- 
    Order:
    {
        Channel:payload.Order.@EnterpriseCode,
        Code:payload.Order.@OrderNo,

        (Status:payload.Order.@Status) when (payload.Order.@Status== "complete") ,

        OrderLines:{
            ((payload.Order.OrderLines.*OrderLine default []) map {
            OrderLine:{
                EntryNumber:$.@PrimeLineNo,
                Status:$.@Status,
                Quantity:$.@OrderedQty
            }
        })
    }

    }

I Want to ignore cases while checking when condition. How to achieve it in Mule dataweave

Upvotes: 1

Views: 6965

Answers (1)

Ryan Carter
Ryan Carter

Reputation: 11606

You could use the upper function like so:

{
 (Field1: payload.Field1) when (upper payload.Field1) == "COMPLETE"
}

Upvotes: 4

Related Questions