Skip to content

Commit 745d165

Browse files
Update src/connections/functions/insert-functions.md
1 parent 6089063 commit 745d165

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/connections/functions/insert-functions.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,16 @@ You can read more about [error handling](#destination-insert-functions-logs-and-
183183

184184
A payload must come into the pipeline with the attributes that allow it to match your mapping triggers. You can't use an Insert Function to change the event to match your mapping triggers. If an event comes into an Actions destination and already matches a mapping trigger, that mapping subscription will fire. If a payload doesn't come to the Actions destination matching a mapping trigger, even if an Insert Function is meant to alter the event to allow it to match a trigger, it won't fire that mapping subscription. Segment sees the mapping trigger first in the pipeline, so a payload won't make it to the Insert Function at all if it doesn't come into the pipeline matching a mapping trigger.
185185

186-
Unlike Source Functions and Destination Functions, an Insert Function can only return one event. This means that when the Insert Function receives an event then only one event will be sent to be handled by its configured mappings. However, if you would like [multiple mappings triggered by the same event](https://segment.com/docs/connections/destinations/actions/#:~:text=Multiple%20mappings%20triggered,Subscription%20Updated%20event.), _please see link's details_, you can do so by creating different types of mappings (Identify, Track, Page, etc) or multiple mappings of the same type, and then configuring the mapping's [trigger conditions](https://segment.com/docs/connections/destinations/actions/#conditions) to look for that event name/ type/ or other available field within the payload, and then configure the mapped fields to send different data. You can also configure the Insert Function to add additional data to be included within the event's payload before its handled by the mappings, and then configure the mapping's available fields to reference the payload's available fields. You may want to consider the event's [context object's](https://segment.com/docs/connections/spec/common/#context) available fields when adding new data to the event's payload.
186+
Unlike Source Functions and Destination Functions, which return multiple events, an Insert Function only returns one event. When the Insert Function receives an event, it sends the event to be handled by its configured mappings.
187+
188+
If you would like [multiple mappings triggered by the same event](/docs/connections/destinations/actions/#:~:text=Multiple%20mappings%20triggered,Subscription%20Updated%20event.):
189+
1. Create different types of mappings (Identify, Track, Page, etc) or multiple mappings of the same type.
190+
2. Configure the mapping's [trigger conditions](/docs/connections/destinations/actions/#conditions) to look for that event name/type or other available field within the payload.
191+
3. Configure the mapped fields to send different data.
192+
193+
You can also configure the Insert Function to add additional data to the event's payload before it's handled by the mappings and configure the mapping's available fields to reference the payload's available fields.
194+
195+
You may want to consider the [context object's](/docs/connections/spec/common/#context) available fields when adding new data to the event's payload.
187196

188197
## Create settings and secrets
189198

0 commit comments

Comments
 (0)