@Anonymous_876e90207c84eec074dc8f1fbdf1c908 様
Run Codeを利用されるのが良いかと思います。
Flowの全体図です。最後のLog outputをKlaviyoのアクションにご変更ください。
Run Codeの内容です。
input
{
order {
lineItems {
product {
handle
}
}
customer {
tags
}
}
}
code
export default function main(input) {
let isSecondPurchase = false;
const handles = input.order.lineItems.map(lineItem => lineItem.product.handle);
handles.forEach(handle => {
if(!isSecondPurchase) isSecondPurchase = input.order.customer.tags.includes(handle);
})
return {
isSecondPurchase: isSecondPurchase
}
}
output
type Output {
isSecondPurchase: Boolean!
}
十分に検証はしていませんので、
うまく動作しない場合は、Run Codeのcode を見直していただくと良いかと思います。
ご参考まで。
(キュー田辺)

