Get element switch node

This is the output with the object items.

Could you please follow the request ? Copy the value from the payload and paste it here.
We cannot see the output of your debug node from this screenshot. And read the documentation for that node (i linked to the same node as you are using).

Uh ok...

payload.options.reply_markup

{"keyboard":[["Apagar luz de prueba"],["Encender luz de prueba"]],"resize_keyboard":true,"one_time_keyboard":true}

The full payload. I would highly recommend to also read the node-red documentation and how to work with messages.

Ok after looking at the howto on the node info.

you will need to put the stringify() back in the function node code. then repost the debug output from the telegram response node. In my first post i thought the debug output was from the response, i now think that is the confirmation message.

You need to clear the telegram response nodes polling error before continuing.

Ok...the pulling error i don't know because it happens...but all works ok...i know there is an error but i can't figured out how to solve it.

This is the output error:

"ETELEGRAM: 409 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"

What are the contents of the function nodes? As it looks like they may be reversed.

image

it ends with a return msg...

There are 2 functions in the howto, the communication function and the response function. I believe that is the communication message function.

your function Iluminacion should be.

It is difficult to tell as we can not see you full flow.

Uhm ok...

Maybe the misunderstood comes when i want to split those two differents arrays elements within the function. The elements makes them to appear on my telegram keyboard, so whatever the option i select i want to have the selected output to follow the flow on the right path.

Maybe i cannot work that function like that and i have to work it around with a different approach.

Confused...

Your confused, think how we feel, we have a fraction of information available to you.

We need a clear understanding of your flow
so post
your flow layout
the contents of your functions.

Its like trying to do a jigsaw through a key hole.

As i said before i think you have your function reversed, but it hard to tell from the keyhole.

Ok...this is my current flows with the inside function details.

[{"id":"8fd07497.19d0d8","type":"function","z":"31d2354e.c7d47a","name":"Bajar Peliculas","func":"msg.payload = {}\nmsg.payload.chatId = 587232739;\nmsg.payload.type = 'message';\nmsg.payload.content = 'OK...procesando...';\n\nvar opts = {\n reply_to_message_id: msg.payload.messageId,\n reply_markup: JSON.stringify({\n keyboard: [\n ['/peliculas']],\n 'resize_keyboard' : true, \n 'one_time_keyboard' : true\n })\n};\n\nmsg.payload.options = opts;\n\nreturn msg;","outputs":1,"noerr":0,"x":740,"y":300,"wires":[["82fcc8bc.934b28"]]},{"id":"e07e373d.d12bf8","type":"function","z":"31d2354e.c7d47a","name":"Iluminacion","func":"msg.payload = {}\nmsg.payload.chatId = 587232739;\nmsg.payload.type = 'message';\nmsg.payload.content = 'OK...procesando...';\n\nvar opts = {\n reply_to_message_id: msg.payload.messageId,\n reply_markup: ({\n keyboard: [\n ['Apagar luz de prueba'],\n ['Encender luz de prueba']],\n 'resize_keyboard' : true, \n 'one_time_keyboard' : true\n })\n};\n\nmsg.payload.options = opts;\n\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":340,"wires":[["3b38334a.687b2c","1da52795.dbf518"]]},{"id":"1da52795.dbf518","type":"delay","z":"31d2354e.c7d47a","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":720,"y":380,"wires":[["6e1d0238.10561c"]]},{"id":"1ec21f4a.b9bc11","type":"debug","z":"31d2354e.c7d47a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":670,"y":540,"wires":[]},{"id":"6e1d0238.10561c","type":"telegram sender","z":"31d2354e.c7d47a","name":"send response","bot":"4a013224.b5a66c","x":740,"y":420,"wires":[["1ec21f4a.b9bc11"]]},{"id":"4a013224.b5a66c","type":"telegram bot","z":"","botname":"fisgon","usernames":"","chatids":"587232739","baseapiurl":"","updatemode":"polling","pollinterval":"400","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":true}]

Ok now fix your post and put the exported flow between
```
export
```
As the flow has error due to how you posted it
all code should be posted surrounded by ```

ok..done it!

How are you triggering this flow is ther a command sent from the telegram message?

Yes im triggering the command with a /menu telegram command using the telegram node that does that, allowing me to capture it.

ok i am getting a response on msg.originalMessage.text

input message command test

[{"id":"da76c360.33d9e","type":"tab","label":"Flow 4","disabled":false,"info":""},{"id":"581dc1ad.facb88","type":"function","z":"da76c360.33d9e","name":"Iluminacion","func":"msg.payload.chatId = msg.payload.chatId;\nmsg.payload.type = 'message';\nmsg.payload.content = 'OK...procesando...';\n\nvar opts = {\n reply_to_message_id: msg.payload.messageId,\n reply_markup: JSON.stringify({\n keyboard: [\n ['Apagar luz de prueba'],\n ['Encender luz de prueba']],\n 'resize_keyboard' : true, \n 'one_time_keyboard' : true\n })\n};\n\nmsg.payload.options = opts;\n\nreturn msg;","outputs":1,"noerr":0,"x":420,"y":280,"wires":[["5b82c470.593b64"]]},{"id":"9f91613.55fb42","type":"debug","z":"da76c360.33d9e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"originalMessage.text","targetType":"msg","x":560,"y":420,"wires":[]},{"id":"5b82c470.593b64","type":"telegram sender","z":"da76c360.33d9e","name":"","bot":"8497aed3.3ec0f8","x":640,"y":280,"wires":[[]]},{"id":"c5db8d7.6ccf9f","type":"switch","z":"da76c360.33d9e","name":"","property":"originalMessage.text","propertyType":"msg","rules":[{"t":"eq","v":"Apagar luz de prueba","vt":"str"},{"t":"eq","v":"Encender luz de prueba","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":400,"y":340,"wires":[["9f91613.55fb42"],["9f91613.55fb42"]]},{"id":"3c5c1742.be4278","type":"telegram command","z":"da76c360.33d9e","name":"","command":"test","bot":"8497aed3.3ec0f8","strict":false,"hasresponse":true,"x":140,"y":200,"wires":[["581dc1ad.facb88"],["c5db8d7.6ccf9f"]]},{"id":"8497aed3.3ec0f8","type":"telegram bot","z":"","botname":"e1cidbot","usernames":"","chatids":"","baseapiurl":"","updatemode":"polling","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"6667","socksusername":"anonymous","sockspassword":"","bothost":"","localbotport":"8443","publicbotport":"8443","privatekey":"","certificate":"","useselfsignedcertificate":false,"sslterminated":false,"verboselogging":false}]

uhm ok, but you are not passing the input /test over the iluminacion function, i mean, that function node shows up the keyboard on Telegram. I see that you are passing directly the message over the Switch node...

Where should i make that decision?

Sorry your question is not clear to me. What decision

The decision of what option to choose.
Apagar luz de prueba
Encender luz de prueba

The switch node makes the decision of what the pressed keyboard value is. Depending on the return value the switch will use the first or second output.

edit/
The returned value is also available at -
msg.payload.content