bandungeuy
bandungeuy

Reputation: 512

How to Update Data with keys from array payload trigger?

I have this event hook trigger in my directus flows:

{
  "type": "action",
  "scope": [
    "items.create"
  ],
  "collections": [
    "product_transaction"
  ]
}

and this is the payload:

{
  "event": "product_transaction.items.create",
  "payload": {
    "product_carts": [
      {
        "products_cart_id": {
          "id": 129
        }
      },
      {
        "products_cart_id": {
          "id": 130
        }
      }
    ],
    "total_price": 10000,
    "payment_channel": {
      "id": "18"
    }
  },
  "key": 169,
  "collection": "product_transaction"
}

I want to update the status of products_cart collection with id in $trigger.payload.product_carts. How can I do that?

Upvotes: 0

Views: 66

Answers (0)

Related Questions