'Multiple conditions in the Choiceset
I am trying to check multiple fields on the Choiceset using the Logical AND OR but it is throwing error.Below is the expression I tried
not isEmpty(vars.quoteLineItemId) AND (not isEmpty(payload.PhaseLevelItemNumber) OR not isEmpty(payload.PhaseLevelItemName)
And the error is like Unexpected end of input, expected ')' for the enclosed expression. (line 1, column 124):
I even tried below expression but no luck
vars.quoteLineItemId!=empty AND (payload.PhaseLevelItemNumber!=empty OR payload.PhaseLevelItemName!=empty)
Any help is greatly appreciated
Solution 1:[1]
Please make sure to provide sample input and expected output when you ask a question.
Payload
{
"PhaseLevelItemNumber": "Hello world!",
"PhaseLevelItemName": " Hello Mars"
}
Script
%dw 2.0
output application/json
var quoteLineItemId = "asdasdad"
---
not (isEmpty(quoteLineItemId) and ((not isEmpty(payload.PhaseLevelItemNumber) or not isEmpty(payload.PhaseLevelItemName))))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Salim Khan |
