简体   繁体   中英

Can't get Power Automate Filter Array to render distinct result

I've got 2 Arrays. One of the Arrays is a list of Office 365 Contacts. The other Array contains a list of Customers from an API. I've used a Select statement on my Contacts Array, so that it is in the same format as my Customer Array. When I create the following Filter Array, I never get the distinct item I'm looking for.

Here is the Code when I use Peek Code.

{
    "inputs": {
        "from": "@variables('Customers Arrary')",
        "where": "@not(contains(variables('Contacts Array'), item()))"
    },
    "metadata": {
        "operationMetadataId": "9ab3697e-6f5c-41b4-b94e-41641ce3dacf"
    }
}

The result I'm looking for is to find all the items in the Customer Array that don't match to anything in the Contacts Array. The unique identifiers are email address and mobile number.

Any help is much appreciated! Thanks in advance!

I finally got this to work. In order for this to work, the data sets have to match. For example, if you are comparing two data sets against an email address, that's the only data you can have, and you better not have any null values. Here is an example filter I created. The JSON from the two arrays only contains email address values.

在此处输入图像描述

So, make sure and remove any data that does not appear in both data sets. I would also remove any items that contain null values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM