Skip to content

Rule.io SDK


Rule.io SDK / rcml/src / createLoopValueNode

Function: createLoopValueNode()

createLoopValueNode(jsonKey, options?): LoopValueNode

Defined in: rcml/src/email/create-rcml-element.ts:1284

Create a loop-value node — references the current iteration's value inside an <rc-loop> body. At render time the renderer replaces the token with the per-iteration source value.

Parameters

jsonKey

string

The loop variable name (typically a JSON property key on the iteration item, e.g. title, price).

options?

Optional overrides:

  • index — iteration identifier (defaults to jsonKey).
  • original — source-token override (defaults to [LoopValue:<jsonKey>]).

index?

string

original?

string

Returns

LoopValueNode

A typed LoopValueNode.

Example

ts
// Inside an <rc-loop> that iterates over products:
createInlineContent([
  createTextNode('Product: '),
  createLoopValueNode('title'),
  createTextNode(' — '),
  createLoopValueNode('price'),
])