【ShopifyFlow】顧客メタフィールドの値を顧客タグに反映

Shopify Flow以下を実現したいのですが可能でしょうか?

ご教示いただければ幸いです。


注文があったときに

注文した顧客の顧客タグに

既に『_tag』を含んだ顧客タグがあった場合はそのタグを削除。

その上で、特定の顧客メタフィールド(例:customer.metafields.rank.info)の値を

値の末尾に『_tag』と付けた状態で、新規顧客タグとして入れる。

例:メタフィールドの値が『GOLD』だったとき
GOLD_tagという顧客タグが入る。

試作していませんが以下のようにすれば対応できるのではと思います。

  1. Order create トリガー
  2. Condition で order > customer > metafileds > 値(GOLD)を入力
  3. Remove customer tags
  4. Add customer tags

Condition に関しては以下などの情報を探して参照ください。

https://help.shopify.com/ja/manual/shopify-flow/reference/conditions

https://community.shopify.com/post/1713926

(上記はCusotmerに読み替え可能です)

以上ですが、よくわからない場合はShopifyサポートに相談したり、エキスパートやパートナーに依頼されることをお勧めします。

回答ありがとうございます!

すみません…質問後も試行錯誤していた結果下記の方法で解決いたしました。

いただいたCondition の記事につきましては別のFlowを組む際の参考にさせていただきます。

ありがとうございました。


●Order create トリガー
●Remove customer tags
{% for tag in order.customer.tags %} {% if tag contains ‘_tag’ %} {{tag}} {% endif %} {% endfor %}

●Add customer tags
{% for metafields_item in order.customer.metafields %} {% if metafields_item.key == ‘info’ %} {{metafields_item.value}}_tag {% endif %} {% endfor %}