I’m looking to possibly achieve a similar effect through Zapier formatter or filter to what lodash does with differenceBy utility function.
For example, having a trigger which comes with an object of following format:
{
current: {
labels: :{
id: '5f212d395422021ebc4b7041',
slug: 'old-label-1'
}, {
id: '5f212d395422021ebc4b7042',
slug: 'old-label-2'
},{
id: '5f212d395422021ebc4b7043',
slug: 'new-label'
}]
},
previous: {
labels: :{
id: '5f212d395422021ebc4b7041',
slug: 'old-label-1'
}, {
id: '5f212d395422021ebc4b7042',
slug: 'old-label-2'
}]
}
}
The effect of running differenceBy on this data would look like:
> _.differenceBy(data.current.labels, data.previous.labels, (i) => i.slug)
/ { id: '5f212d395422021ebc4b7043', slug: 'new-label' } ]
Would be awesome to achieve this through Zapier utilities otherwise I think the best next option would be having a separate trigger that only detects new labels?
Cheers!