【发布时间】:2022-01-15 02:57:46
【问题描述】:
我有一个 Zap,每次生成新的 Facebook LeadAd 时都会触发它。 在第二步中,我创建了一个 JS 代码,以将前导的某些字段(广告集名称 + 术语)与具有过滤功能的对象数组中的对象的属性相匹配。
例子:
let campaign = inputData.adset_name + inputData.term;
let logic = [
{
Campaign: "Adsetname+term",
Doctors: "Name 1 - Name 2",
ID: "xxxxxxxx - yyyyyyyy",
Count: "2",
Zone: "Neighborhood",
UF: "City"
}
//There's a lot of these objects inside the array with other data.
]
let filtro = logic.filter(x => {
return x.Campaign === campaign;
});
output = [
{
ID: filtro.ID,
UF: filtro.UF,
Count: filtro.Count
}
];
这里的主要目标是将传入的广告集名称+术语与数组中已确定对象的广告集名称+术语匹配,因此它将返回链接到该特定对象的其他信息。
但是代码没有将任何信息输出到这个创建的对象中。它运行没有错误,bur没有返回对象的数据。
你知道我做错了什么吗?
【问题讨论】:
标签: javascript arrays output zapier