---
source: https://iinventedlight.com/library/notes/helm-control-structures.md
title: "Helm flow control: if, with, and range in chart templates"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (The Helm Authors); MIT (The Helm Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: The Helm Authors, Flow Control; The Helm Authors, Flow Control (source). MIT (https://raw.githubusercontent.com/helm/helm-www/main/LICENSE). Copyright The Helm Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-24
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-24
as_of: 2026-11-24
confidence: medium
untested: "Not reproduced (2026-11-24). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: helm-control-structures"
tags: [helm, templates, if, range, with]
client: Librarian
sources:
  - id: S1
    title: "Flow Control"
    publisher: The Helm Authors
    url: https://helm.sh/docs/chart_template_guide/control_structures/
    accessed: 2026-11-24
    license: "MIT"
  - id: S2
    title: "Flow Control (source)"
    publisher: The Helm Authors
    url: https://raw.githubusercontent.com/helm/helm-www/main/docs/chart_template_guide/control_structures.md
    accessed: 2026-11-24
    license: "MIT"
---
# Helm flow control: if, with, and range in chart templates
**Answer:** Helm's template language provides the following control structures.

## The main actions

Control structures, called actions in template parlance, give you the ability to control the flow of a template's generation.

if and else are for creating conditional blocks.

with is used to specify a scope.

range provides a for each-style loop.

## Where the rest lives

The others are covered in the Named Templates section later in this guide.

Let's add a simple conditional to our ConfigMap.

A pipeline is evaluated as false for the empty or zero-like values listed on the page.

The first control structure the page looks at is for conditionally including blocks.

## See also

- [helm-template-functions](https://iinventedlight.com/library/notes/helm-template-functions/)
- [helm-values-files](https://iinventedlight.com/library/notes/helm-values-files/)
- [helm-hooks](https://iinventedlight.com/library/notes/helm-hooks/)

## Claims

- id: C1
  claim: Helm's template language provides the following control structures.
  source: S1
  evidence: "Helm's template language provides the following control structures"

- id: C2
  claim: range provides a for each-style loop.
  source: S1
  evidence: "range , which provides a \"for each\"-style loop"

- id: C3
  claim: with is used to specify a scope.
  source: S1
  evidence: "with to specify a scope"

- id: C4
  claim: The others are covered in the Named Templates section later in this guide.
  source: S2
  evidence: "The others are covered in the \"Named Templates\" section later in this guide."

## Sources

- [S1] Flow Control. The Helm Authors. https://helm.sh/docs/chart_template_guide/control_structures/ . License: MIT. Accessed 2026-11-24.

- [S2] Flow Control (source). The Helm Authors. https://raw.githubusercontent.com/helm/helm-www/main/docs/chart_template_guide/control_structures.md . License: MIT. Accessed 2026-11-24.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Helm Authors, Flow Control; The Helm Authors, Flow Control (source). MIT (https://raw.githubusercontent.com/helm/helm-www/main/LICENSE). Copyright The Helm Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
