For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

GET_TREE() Function

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

Returns hierarchy tree values for org-structure filtering (Rippling-specific).

Syntax​

GET_TREE(tree_type, root_id, field, [include_terminated])

Parameters​

ParameterDescriptionData TypeRequired
tree_typeHierarchy type to expand (e.g. Department, Manager, Team)StringYes
root_idRoot node ID to expand fromStringYes
fieldField to return from each node (e.g. id, name)StringYes
include_terminatedOptional flag such as include_terminated to include terminated rolesStringNo

Notes​

  • Org/hierarchy semantics. Common pattern: col IN (GET_TREE(...)).

Example​

SELECT
GET_TREE(org_path, 'department', 'id', 1)
FROM
rippling.employee.Employee
LIMIT
5;