Skip to content
HTTP & JSON jsonIndex

$jsonIndex[]

$jsonIndex returns the current iteration index (0-based) when used inside a $jsonForEach block. This is useful for numbered lists, conditional logic based on position (e.g., treating the first or last element differently), or limiting output to the first N items. Outside of $jsonForEach, it returns 0.

Syntax

bdfd
$jsonIndex[]

Examples

Lookup Value by Index

$jsonParse[{"servers":["Alpha","Beta","Gamma"]}]
$title[Server Lookup]
$description[Selected: **$jsonIndex[servers;1]**]
$color[#5865F2]
$sendMessage[]