I am trying to create a custom payload for my Webhook destination. The input event payload has an array of items and I always want to access fields in the first item of the array. I am able to successfully test the connection if I only access the first item of the array, but when I try to access properties within that item, I get a configuration error.
"${input.events[0].event_type}"
Leads to the error below
There was an issue with sending your test event.<br />Invalid payload or configuration.
But
"${input.events[0]}"
does not lead to any errors. This suggests that accessing the item using the index works correctly, but I can’t find any documentation out there on how to access the properties within that item.
For reference, this is the input event. I redacted some private information. This is an integration between RevenueCat and Amplitude, I need to forward some of this info to another service (Singular) which Amplitude does not have an integration for.
<br />{<br /> "api_key": <redacted>,<br /> "events": [<br /> {<br /> "event_properties": {<br /> "aliases": [<br /> <redacted><br /> ],<br /> "app_id": <redacted>,<br /> "app_user_id": <redacted>,<br /> "cancel_reason": "UNSUBSCRIBE",<br /> "currency": "USD",<br /> "entitlement_id": null,<br /> "entitlement_ids": [<br /> "Default"<br /> ],<br /> "environment": "SANDBOX",<br /> "expiration_at": "2023-11-30T17:02:04Z",<br /> "original_app_user_id": <redacted>,<br /> "original_transaction_id": <redacted>,<br /> "period_type": "NORMAL",<br /> "presented_offering_id": null,<br /> "product_id": <redacted>,<br /> "purchased_at": "2023-11-30T16:02:04Z",<br /> "revenue": 0,<br /> "store": "APP_STORE",<br /> "subscriber_attributes": {<br /> "$fbAnonId": <redacted>,<br /> "$idfa": <redacted>,<br /> "$idfv": <redacted>,<br /> "$ip": <redacted>,<br /> "$onesignalId": <redacted>,<br /> "$onesignalUserId": <redacted><br /> },<br /> "transaction_id": <redacted><br /> },<br /> "event_type": "cancellation_event",<br /> "insert_id": <redacted>,<br /> "partner_id": "revenuecat",<br /> "platform": "iOS",<br /> "productId": <redacted>,<br /> "revenue": 0,<br /> "time": 1701360394149,<br /> "user_id": <redacted>,<br /> "user_properties": {<br /> "rc_subscription_status": "cancelled"<br /> }<br /> }<br /> ],<br /> "options": {<br /> "min_id_length": 5<br /> }<br />}