# Pipeline switch block not able to output second value

**URL:** <https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809>\
**Category:** Ignition\
**Created:** [June 26, 2025, 12:12am UTC](https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809 "2025-06-26T00:12:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmsfbt](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lmsfbt](https://forum.inductiveautomation.com/u/lmsfbt)\
**Post date:** [June 26, 2025, 12:12am UTC](https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809/1 "2025-06-26T00:12:40Z")

</div>

According to the manual, the syntax of switch block is

```python
//The following would return "Running".
switch(
1, // value
0, 1, 2, // cases 1-3
"Off", // return 1
"Running", // return 2
"Fault", // return 3
"BAD STATE!") // default

```

My logic is

```python
switch(
    "Commercial",
    "Battery", 
    "Commercial",
    "BatteryLow",
    "CommercialPowerLost",
    "Others"
)

```

However, "CommercialPowerLost" never got to output. If I change the compare value to "Battery", "BatteryLow" will output. Please advise.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 26, 2025, 3:26am UTC](https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809/2 "2025-06-26T03:26:34Z")

</div>

Are you creating a [**Switch Block**](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/alarm-notification/alarm-notification-pipelines/pipeline-blocks#switch-block), or an [expression block](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/alarm-notification/alarm-notification-pipelines/pipeline-blocks#expression-block) that _contains_ a switch expression?

---

<div class="post-metadata">

**Author:** ![lmsfbt](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lmsfbt](https://forum.inductiveautomation.com/u/lmsfbt)\
**Post date:** [June 26, 2025, 5:18pm UTC](https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809/3 "2025-06-26T17:18:37Z")

</div>

Hi PGriffith,

I am creating a Switch Block within Alarm Pipeline.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 26, 2025, 5:30pm UTC](https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809/4 "2025-06-26T17:30:17Z")

</div>

In a switch _block_, you don't actually write out a switch expression. You write an expression that returns a single value (such as a tag reference `{path/to/tag}` or other logic), and then add 'cases' to the switch block via the GUI. The switch block will run your expression once and then look up which case to enter based on the provided inputs.

---

<div class="post-metadata">

**Author:** ![lmsfbt](https://avatars.discourse-cdn.com/v4/letter/l/ecb155/32.png) [@lmsfbt](https://forum.inductiveautomation.com/u/lmsfbt)\
**Post date:** [June 26, 2025, 7:02pm UTC](https://forum.inductiveautomation.com/t/pipeline-switch-block-not-able-to-output-second-value/107809/5 "2025-06-26T19:02:18Z")

</div>

I c. Thank you
