Reputation: 67
I am filtering on an array of addresses. A type attribute determines the address category (POSTAL,RES,WORK etc). I need to filter only the POSTAL and RES address from this array.
I tried to use the filer array action , but it can take only one filter condition.
Can it be edited in the code view to achieve multiple filter conditions ? If yes, what is correct syntax for it.
{
"Name": "Douglas Adams",
"Address": [
{
"Type": "POSTALS",
"street_address": "42",
"city": "Milky Way",
"state": "HI"
},
{
"Type": "RES",
"street_address": "1618",
"city": "Golden ratio",
"state": "MA"
},
{
"Type": "BILLING",
"street_address": "1618",
"city": "Golden ratio",
"state": "MA"
}
]
}
Upvotes: 3
Views: 10472
Reputation: 20067
Can it be edited in the code view to achieve multiple filter conditions ?
In short, Yes. Logic Apps now supports multiple rules in a condition block. Here is a issue you could refer to.
Because I do not know the action above your Filter array, so I will give you a similar syntax (e.g. http body is equal 'bbb' and http headers is equal 'aaa') as below:
@and(equals(triggerOutputs()['headers'],'aaa'), equals(triggerBody(),'bbb'))
You could modify to your situation and fill into edit in basic mode
in Filter array.
For more details, you could refer to this thread.
Upvotes: 9