Skip to main content

Using Event Data in Actions

When an alert fires, TipLink has information about the event that triggered it, like the viewer's name, the donation amount, or the message they included. You can insert this information directly into your action text using a simple {{ }} syntax.

No coding needed. Just curly braces around a field name.


How It Works

Anywhere you can type text in an action (overlay message, Discord message, chat message, etc.), you can use a template variable to insert live event data.

Basic format:

{{ fieldName }}

Example — Overlay message:

{{ username }} just donated {{ value }}!

If username is "CoolViewer42" and value is 10, TipLink sends:

CoolViewer42 just donated 10!


Common Event Fields

These fields are available in most events. Exact availability depends on the platform and event type.

FieldWhat it containsExample output
{{ username }}The viewer's username or display nameCoolViewer42
{{ value }}The numeric value of the event (donation amount, sub count, bits)10
{{ message }}The message the viewer includedKeep it up!
{{ currency }}The currency of a donationUSD
{{ type }}The event typedonation
{{ platform }}The platform the event came fromtwitch
Finding all available fields

Open the Activity page, find an event, and click the magnifying glass icon to view its full details. All fields listed under metadata can be used in the format {{ fieldName }}.

For example, if you see metadata.id, you can access it with {{ id }}.


Fallback Values

If a field doesn't exist in the event data, TipLink will output nothing (an empty string) by default.

To show a different value when a field is missing, add a fallback using |:

{{ username | "Anonymous" }}
  • If username exists: shows the actual username.
  • If username is missing: shows Anonymous.

Examples:

{{ message | "No message provided" }}
{{ currency | "USD" }}
{{ value | 0 }}

Nested Fields

If the field you want is nested (e.g. metadata.profilePicture), TipLink automatically flattens event data so you can access it directly.

Example: To access root.data.metadata.id, you write {{ id }}.


Using Action Output Data

You can also use the result of one action in another action on the same alert. This is useful for showing calculated values, like the final shock intensity.

Format:

{{ actionType.operationKey.fieldName }}

Examples:

{{ pishock.main_op.intensity }}     ← PiShock intensity %
{{ pishock.main_op.duration }} ← PiShock duration (seconds)

To see what fields an action exposes, look at the action's documentation page.


Practical Examples

Show the donor name and amount

{{ username }} donated {{ value }} {{ currency }}! Thank you!

With a fallback for anonymous donations

{{ username | "Someone" }} tipped {{ value | "an amount" }}. Thank you!

Discord webhook message

**{{ username }}** donated **${{ value }}**
Message: {{ message | "*(no message)*" }}

Variable-based death counter in overlay

Deaths today: {{ variables.death_count }}

Math Transforms

Numeric placeholder values support inline mathematical operations using the pipe (|) syntax. This lets you convert raw event values into the units you actually want — for example, converting bits to dollars, or formatting a value to two decimal places.

Place the operation after the field name, separated by a pipe:

{{ fieldName | operator }}

Available operators:

OperatorWhat it does
* NMultiply by N
/ NDivide by N
+ NAdd N
- NSubtract N
toFixed:NRound to N decimal places

Examples:

{{ value | * 100 }}
{{ tokens | / 100 }}
{{ amount | + 5 }}
{{ amount | - 3 }}
{{ amount | toFixed:2 }}

Chaining Transforms

You can chain multiple transforms together. They apply left to right:

{{ bits | * 0.01 | toFixed:2 }}

If bits is 1337, the result is 13.37.

{{ tokens | / 100 | toFixed:2 }}

If tokens is 999, the result is 9.99.

{{ amount | * 2 | + 1 }}

If amount is 5, the result is 11.

Chaining with a Fallback

A fallback string can be placed at the end of a transform chain:

{{ value | * 0.01 | toFixed:2 | "0.00" }}

If value is missing, shows 0.00. If present, the math transforms apply first.

Safety Notes

  • If the value is not a number, the math transforms are skipped and the original value passes through unchanged.
  • Division by zero returns the original value unchanged.

Tips

  • Template variables work in all text fields across all action types — overlay messages, Discord messages, chat messages, HTTP request bodies, and more.
  • Field names are case-sensitive. username and Username are different.
  • You can mix static text and template variables freely in the same field.
  • If you see a blank output when testing, check the event's detail view (Activity → magnifying glass) to confirm the field name and spelling.