简体   繁体   English

无法让 Power Automate 过滤器阵列呈现不同的结果

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

I've got 2 Arrays.我有 2 个数组。 One of the Arrays is a list of Office 365 Contacts.其中一个数组是 Office 365 联系人列表。 The other Array contains a list of Customers from an API.另一个数组包含来自 API 的客户列表。 I've used a Select statement on my Contacts Array, so that it is in the same format as my Customer Array.我在我的联系人数组上使用了一个 Select 语句,因此它的格式与我的客户数组相同。 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.这是我使用 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.来自两个数组的 JSON 仅包含电子邮件地址值。

在此处输入图像描述

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.我还将删除任何包含空值的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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