# Run Email based on conditional value

**URL:** <https://forum.knime.com/t/run-email-based-on-conditional-value/17919>\
**Category:** KNIME Analytics Platform\
**Created:** [September 5, 2019, 9:33pm UTC](https://forum.knime.com/t/run-email-based-on-conditional-value/17919 "2019-09-05T21:33:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavvanr](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/958977/32.png) [@lavvanr](https://forum.knime.com/u/lavvanr)\
**Post date:** [September 5, 2019, 9:33pm UTC](https://forum.knime.com/t/run-email-based-on-conditional-value/17919/1 "2019-09-05T21:33:53Z")

</div>

Hi,

I’m trying to use the Send Email node conditionally. I want the Send Email node to execute if a field in my workflow has the value of 1.

if value = 1 Then run Send Email  
Else stop execution

![image](https://forum-cdn.knime.com/uploads/default/original/2X/8/843570b47f0104c34315403d711debfbe3340ae6.png)

Thank you

---

<div class="post-metadata">

**Author:** ![armingrudd](https://forum-cdn.knime.com/user_avatar/forum.knime.com/armingrudd/32/84633_2.png) [@armingrudd](https://forum.knime.com/u/armingrudd)\
**Post date:** [September 5, 2019, 9:57pm UTC](https://forum.knime.com/t/run-email-based-on-conditional-value/17919/2 "2019-09-05T21:57:06Z")

</div>

Hi @lavvanr,

That’s what [IF Switch](https://nodepit.com/node/org.knime.base.node.switches.manualif.ManualIfNodeFactory) node does.

Use a [Table Row to Variable](https://nodepit.com/node/org.knime.base.node.flowvariable.tablerowtovariable.TableToVariableNodeFactory) node to convert the “value” to flow variable then a [Rule Engine Variable](https://nodepit.com/node/org.knime.base.node.rules.engine.RuleEngineVariableNodeFactory) node to create a new variable based on the value which would be “top” if value = 1 and “bottom” if value is not 1 then use this variable to select the port in IF Switch node.

😊

---

<div class="post-metadata">

**Author:** ![s.roughley](https://forum-cdn.knime.com/user_avatar/forum.knime.com/s.roughley/32/366_2.png) [@s.roughley](https://forum.knime.com/u/s.roughley)\
**Post date:** [September 6, 2019, 6:07am UTC](https://forum.knime.com/t/run-email-based-on-conditional-value/17919/3 "2019-09-06T06:07:36Z")

</div>

Or easier, use table row to variable followed by the `If switch(Flow variable value)` node in the Vernalis contribution  
Steve

---

<div class="post-metadata">

**Author:** ![lavvanr](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/958977/32.png) [@lavvanr](https://forum.knime.com/u/lavvanr)\
**Post date:** [November 25, 2019, 3:13pm UTC](https://forum.knime.com/t/run-email-based-on-conditional-value/17919/4 "2019-11-25T15:13:50Z")

</div>

Thank you @armingrudd!

Your solution worked very well.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 26, 2020, 3:25am UTC](https://forum.knime.com/t/run-email-based-on-conditional-value/17919/5 "2020-05-26T03:25:21Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
