Handbook · Reference · Blockly · Tree

Blockly: Tree

Where in the UI. Scripts tab toolbox.

Walk the item tree: roots, parent, children, placeholders, ids.

Block idRead asPurpose
containd_list_root_item_refslist root item refscallHost(listRootItemRefs) → number[] of top-level location root ids
containd_get_root_item_refget root item refcallHost(getRootItemRef) → item id (0 if missing); use 0 for the bound item
containd_get_parent_item_refget parent item refcallHost(getParentItemRef) → parent item id (0 if none); use 0 for bound item
containd_list_child_item_refslist child item refscallHost(listChildItemRefs) → number[] of direct child ids; use 0 for bound item
containd_list_sibling_item_refslist sibling item refscallHost(listSiblingItemRefs) → number[] same parent excluding self; use 0 for bound item
containd_item_existsitem existstrue when the item row exists; use 0 for bound item
containd_item_is_placeholderitem is placeholdertrue when originalId > 0; use 0 for bound item
containd_get_original_item_refget original item refcallHost(getOriginalItemRef) → original item id for a placeholder (0 if not a placeholder / missing); use 0 for bound item
containd_list_placeholder_item_refslist placeholder item refscallHost(listPlaceholderItemRefs) → number[] of placeholders for the canonical original; use 0 for bound item
containd_get_item_ref_by_uuidget item ref by uuidcallHost(getItemRefByUuid) → item id for collectionShareId UUID (0 when not found)
containd_get_item_uuidget item uuidcollectionShareId for the item (mints if missing); use 0 for bound item
containd_ensure_internal_product_codeensure internal product codefill internalProductCode if empty (same as label create); no-op if already set; use 0 for bound item
containd_item_ref_list_lengthitem ref list lengthArray length for child/sibling/graph/placeholder/root item id lists
containd_item_ref_list_last_indexitem ref list last indexLast valid index (length − 1) for controls_for: from 0, to this value, by 1. Returns 0 when list is empty.
containd_item_id_at_index_in_ref_listitem id at index in ref listRead one id from a tree/graph item id list (also accepts legacy ItemRef[]). Plug into ContaindData “… on item”.
containd_item_id_from_item_refitem id from item refUsually unnecessary — tree/graph lists already return numbers. Compat: coerces a legacy ItemRef or bare number via __resolveItemId.
containd_bound_item_idbound item idNumeric id of the script bound item (onCreate / action handler context)
containd_item_is_rootitem is rootTrue when the item has no parent; use 0 for the bound item