Hi, inside transformations - how do I also allow t...
# support
c
Hi, inside transformations - how do I also allow the ‘identity’ call to pass through? Example:
m
Hey There! 👋 Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
c
/***
* This transformation allows events to reach a downstream destination only if a specific property
* contains certain values, e.g., allow only Product Added, or Order Completed events, or send
* certain event types to a particular destination, or only send events that do not have
* tracking plan to a specific destination
***/
export function transformEvent(event, metadata) {
const property = event.event; // Edit event name
const allowlist = ["registered", "identify", "Order Completed", "added_to_cart", "attended", "call_to_action" ]; // Edit allowlist contents
if (!property || !allowlist.includes(property)) return;
return event;
}
I’m noticing the rule above blocks all identify calls for some reason….
m
`export function transformEvent(event, metadata) {
Copy code
⁣
const property = event.event; // Edit event name`⁣ ` if (property === "identify") return event;`⁣ ` const allowlist = ["registered", "identify", "Order Completed", "added`⁣`_⁣to_⁣⁣`⁣`cart", "attended", "call`⁣`_⁣to_⁣⁣`⁣`action" ]; // Edit allowlist contents`⁣ ` if (!property || !allowlist.includes(property)) return;`⁣ ` return event;`⁣ `}`⁣
The above should help identify events being sent. Kindly ensure that event.event is present and set to the correct type.
c
@shy-kite-21035 Could you kindly double check the above? I’m getting invalid characters
s
Copy code
export function transformEvent(event, metadata) {
  const property = event.event; // Edit event name⁣
  if (property === "identify") return event;
  const allowlist = ["registered", "identify", "Order Completed", "added⁣⁣to⁣⁣⁣cart", "attended", "call⁣⁣to⁣⁣⁣action"]; // Edit allowlist contents
  if (!property || !allowlist.includes(property)) return;
  return event;
}
Yes sometimes when we copy and paste, slack changes
"
to similar to double quotes. Though they look similar they are not the same.
c
@shy-kite-21035 THe above still doesn’t work. Can you assist? Still blocks identify calls
m
Can you provide the sample event payload that you are sending through the HTTP source. I see that the identify events getting dropped are from this source. You can provide the sample from the source live-events.