# Send Telegram Bot a value only if requested

**URL:** <https://discourse.nodered.org/t/send-telegram-bot-a-value-only-if-requested/1930>\
**Category:** General\
**Created:** [31 July 2018 14:24 UTC](https://discourse.nodered.org/t/send-telegram-bot-a-value-only-if-requested/1930 "2018-07-31T14:24:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvas](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mvas](https://discourse.nodered.org/u/mvas)\
**Post date:** [31 July 2018 14:24 UTC](https://discourse.nodered.org/t/send-telegram-bot-a-value-only-if-requested/1930/1 "2018-07-31T14:24:52Z")

</div>

Hi everyone, I'm trying to use a Telegram bot to receive a measure from the Serial node. I need to have a continuous measure to use it in the dashboard but I also want to see that measure in my telegram bot when requested. The idea is to send my bot a word and receive the measure as an answer. Example: send: "Voltage" // answer: "1 V".

My program:

 ![Sin%20t%C3%ADtulo](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/9fb4619ac23e2a4da28d7fac9111b41626af0325.jpg)

The problem is that the bot is answering continously and not on my request.

Any help is appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [31 July 2018 14:32 UTC](https://discourse.nodered.org/t/send-telegram-bot-a-value-only-if-requested/1930/2 "2018-07-31T14:32:25Z")

</div>

Hi @mvas

you need to split this into two separate flows.

In the top flow, add a Change node to store the latest value in flow context (`set flow.myValue to msg.payload` (assuming the reading is in msg.payload..))

Then in the telegram-triggered flow, you can use a Change node to retrieve that flow context value (`set msg.payload to flow.myValue`) and send it on.

Nick

---

<div class="post-metadata">

**Author:** ![mvas](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mvas](https://discourse.nodered.org/u/mvas)\
**Post date:** [31 July 2018 16:17 UTC](https://discourse.nodered.org/t/send-telegram-bot-a-value-only-if-requested/1930/3 "2018-07-31T16:17:58Z")

</div>

I've do it and It worked perfectly.

Thank you Nick
