Reputation: 16219
I have two arrays variables and values like below
arraydata1 =
[
{
"id": "1",
"name": "aaa"
},
{
"id": "2",
"name": "bbb"
},
{
"id": "3",
"name": "ccc"
},
{
"id": "4",
"name": "ddd"
},
{
"id": "14",
"name": "bbb"
}
]
arraydata2 =
[
{
"id": "111",
"tablename": "aaa"
},
{
"id": "222",
"tablename": "bbb"
}
]
output -
[
{
"id": "1",
"name": "aaa"
},
{
"id": "2",
"name": "bbb"
},
{
"id": "14",
"name": "bbb"
},
]
using 2 foreach also i'm able to achieve this but it takes time to compare.
also tried using taken a for-each connector
and inside that used contains
expression to compare name and tablename
but for all values it is false.
contains(variables('arraydata2'),items('For_each')?['tablename'])
can we do it without using 2 foreach
Upvotes: 1
Views: 3415
Reputation: 1984
//Updated to one for each loop:
The following will return 2 objects, you won't get the true
reply but you will have the objects instead.
items('For_each')['name']
and item()['tablename']
Upvotes: 2