# Trigger a string

**URL:** <https://forum.xod.io/t/trigger-a-string/99>\
**Category:** Uncategorized\
**Created:** [August 29, 2017, 8:27am UTC](https://forum.xod.io/t/trigger-a-string/99 "2017-08-29T08:27:39Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![szynyszyl](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@szynyszyl](https://forum.xod.io/u/szynyszyl)\
**Post date:** [August 29, 2017, 8:27am UTC](https://forum.xod.io/t/trigger-a-string/99/1 "2017-08-29T08:27:39Z")

</div>

Hi to all, this is my first post, sorry for bad English 🙂

Is there any way to “trigger a string”?  
And by that i mean to output string from “if…else” block.  
I need some kind of triggering mechanism for gas sensor project. What i want to achieve is something like that: “If value is above 0.7, then print “warning” in second row of 2x16 LCD”. Unfortunately, output from “if…else” block can only be number.  
Is it possible to achieve that with XOD?

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [August 29, 2017, 8:30am UTC](https://forum.xod.io/t/trigger-a-string/99/2 "2017-08-29T08:30:28Z")

</div>

Hello!

Thanks for trying.

> [@szynyszyl](#):
>
> Is there any way to “trigger a string”?
> 
> And by that i mean to output string from “if…else” block.

Not yet. I understand your problem, but there is no out-of-the box `if-else` node for strings. Strings support is still very basic. We’ll improve it in one of nearest updates.

---

<div class="post-metadata">

**Author:** ![szynyszyl](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@szynyszyl](https://forum.xod.io/u/szynyszyl)\
**Post date:** [August 29, 2017, 11:09pm UTC](https://forum.xod.io/t/trigger-a-string/99/3 "2017-08-29T23:09:55Z")

</div>

Thanks for fast reply.

Cant wait to see that functionality.

---

<div class="post-metadata">

**Author:** ![ddelk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ddelk/32/71_2.png) [@ddelk](https://forum.xod.io/u/ddelk)\
**Post date:** [September 11, 2017, 11:37pm UTC](https://forum.xod.io/t/trigger-a-string/99/4 "2017-09-11T23:37:13Z")

</div>

A string multiplexer would do the work and I would love that.

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [September 12, 2017, 10:38am UTC](https://forum.xod.io/t/trigger-a-string/99/5 "2017-09-12T10:38:41Z")

</div>

> [@ddelk](#):
>
> A string multiplexer would do the work

Could you explain multiplexing as you see it? Am I right, you mean several variants as inputs and an additional input which serves as a selector, and the node outputs the selected variant?

---

<div class="post-metadata">

**Author:** ![ddelk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ddelk/32/71_2.png) [@ddelk](https://forum.xod.io/u/ddelk)\
**Post date:** [September 13, 2017, 12:27am UTC](https://forum.xod.io/t/trigger-a-string/99/6 "2017-09-13T00:27:10Z")

</div>

Exactly.

The node doesn’t need to be specific, it could acommodate datatype as a node setting.  
I just made an on-the-fly example using Quartz composer for you.

Orange wires mean that some datatype conversion happens along the way. I love that about this IDE, it is very, very not punitive. But what could make more sense when you connect an index output to a string input? 😉

[https://www.dropbox.com/s/rqjbe7afqyivezl/dd\_multiplexers.mov?dl=0](https://www.dropbox.com/s/rqjbe7afqyivezl/dd_multiplexers.mov?dl=0)

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [September 13, 2017, 6:31am UTC](https://forum.xod.io/t/trigger-a-string/99/7 "2017-09-13T06:31:44Z")

</div>

Aha! Thank you for the screencast. Now it’s clear. We’re going to support something similar in XOD.

---

<div class="post-metadata">

**Author:** ![ddelk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/ddelk/32/71_2.png) [@ddelk](https://forum.xod.io/u/ddelk)\
**Post date:** [September 13, 2017, 1:02pm UTC](https://forum.xod.io/t/trigger-a-string/99/8 "2017-09-13T13:02:37Z")

</div>

My custom node which displays the _index_ at the bottom of the window is actually a pulse triggering a ramp.

---

<div class="post-metadata">

**Author:** ![awgrover](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@awgrover](https://forum.xod.io/u/awgrover)\
**Post date:** [September 27, 2017, 9:21pm UTC](https://forum.xod.io/t/trigger-a-string/99/9 "2017-09-27T21:21:35Z")

</div>

@szynyszyl asked

> “If value is above 0.7, then print “warning” in second row of 2x16 LCD”. Unfortunately, output from “if…else” block can only be number.  
> Is it possible to achieve that with XOD?

I’ve been playing with writing some lib/ nodes. With the ones I’ve written you could do:

`if/else -> awg/conversions/true-to-pulse -> awg/values/text -> LCD`

see [my lib](https://github.com/awgrover/xod_lib), things in lib/.

I created an example, and tested it for your example, but this forum doesn’t allow .xodball, so I put it at [my github example](https://github.com/awgrover/xod_lib/blob/master/examples/szynyszyl-lcd.xodball)

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [September 28, 2017, 9:24am UTC](https://forum.xod.io/t/trigger-a-string/99/10 "2017-09-28T09:24:54Z")

</div>

> [@awgrover](#):
>
> but this forum doesn’t allow .xodball

Oops. Whitelisted the `.xodball` extension.

---

<div class="post-metadata">

**Author:** ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)\
**Post date:** [November 1, 2017, 8:24am UTC](https://forum.xod.io/t/trigger-a-string/99/11 "2017-11-01T08:24:19Z")

</div>

[`xod/core/if-else-string`](https://xod.io/libs/xod/core/if-else-string/) is available out of the box since [v0.15.0](https://forum.xod.io/t/xod-0-15-1-released/153)

---

<div class="post-metadata">

**Author:** ![aryeduino](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/aryeduino/32/1573_2.png) [@aryeduino](https://forum.xod.io/u/aryeduino)\
**Post date:** [October 16, 2019, 8:28pm UTC](https://forum.xod.io/t/trigger-a-string/99/12 "2019-10-16T20:28:25Z")

</div>

Hi, I could not find it anymore. and the documentation is not working.  
I am looking for an if-else-string as well. and I can NOT see it. Can you assist with finding the way to trigger a string upon conditions.  
I want to be able to send a string of C or F upon condition to an LCD. I want to use a trigger to switch between the two.  
Thanks

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [October 16, 2019, 8:36pm UTC](https://forum.xod.io/t/trigger-a-string/99/13 "2019-10-16T20:36:36Z")

</div>

hi, `if-else` is generic, enter the string value between " ".

![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/3/3478c24c75ef5e773d89c63658bc8a6008cda76c.png)

---

<div class="post-metadata">

**Author:** ![aryeduino](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/aryeduino/32/1573_2.png) [@aryeduino](https://forum.xod.io/u/aryeduino)\
**Post date:** [October 16, 2019, 9:36pm UTC](https://forum.xod.io/t/trigger-a-string/99/14 "2019-10-16T21:36:58Z")

</div>

> [@cesars](#):
>
> " ".

Thank you!  
I now know that I needed the " "…
