Skip to content

Dataport Script Reference: Navigation

These helpers let you look up previous activities in the current execution chain.

context.prev

Shortcut to the activity that directly preceded the current node. Equivalent to context.step(-1).

See General → context.prev.

context.step()

Returns an activity a given number of steps back in the execution chain relative to the current node.

Signature: step(steps: number): Activity | undefined

Example:

js
// Get the activity 2 steps back
const twoBack = context.step(-2)
context.log(twoBack?.data?.response)

INFO

Steps are negative integers — step(-1) is one step back, step(-2) is two steps back, and so on.

context.getNode()

Walks back through the activity chain and returns the first activity belonging to a node with the given description (name).

Signature: getNode(name: string): Activity | undefined

Example:

js
const fetchActivity = context.getNode('Fetch Users')
context.log(fetchActivity?.data?.response)

context.getNodeContext()

Walks back through the context chain and returns the first context whose node has the given description.

Signature: getNodeContext(name: string): Context | undefined

Example:

js
const ctx = context.getNodeContext('Transform Data')
context.log(ctx?.someProperty)