For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/manifest/functions/collections/coalesce.md.

coalesce

Evaluates arguments sequentially and returns the first argument that is not null and not an empty string "".

Signature

coalesce(...values: any) -> any

Parameters

ParameterTypeRequiredDescription
...valuesanyat least 1Candidate values

Return value

Returns the documented result for the function signature.

Example

args = {
  limit  = coalesce(ctx.request.query.limit, 20)
  offset = coalesce(ctx.request.query.offset, 0)
}