hey everyone! I currently have a few webhook sour...
# support
m
hey everyone! I currently have a few webhook sources set up in Rudderstack and wanting to create a transformation that impacts only one of the sources. In the past I’ve always done this by using the event name, however each webhook source has the same webhook_source_event event name, mudding that segmentation. What would be the best way to isolate only one of these sources in a transformation?
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.
Hi Nolan, You can access the source ID inside the transformation code like so:
Copy code
const sourceId = metadata(event).sourceId
Then you can use some
if/else
statement to only apply code blocks to a specific source like so:
Copy code
if (sourceId === '<REPLACE_WTIH_SOURCE_ID>') {
   // run code
}
Let me know if this helped and if you have additional questions.
m
ah awesome! I didn’t see the source in the payload under live events so wasn’t sure if it worked in transformations
that totally solves my issue, thanks David!
✅ 1
m
Great! let me know if any other questions come up 🙂