Less than expected

I have two incoming ids from the item_lists node which I pass to the telegram node. As soon as I want to expect three incoming ids and only two come, I get an error, how can I get around it?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hello @KamaR thank you for your post.

In your case, the error is caused by the response of the telegram API, because the third button you are trying to create has an empty text if you only provide the first two ids.

If you only plan on having 2 or 3 incoming ids, your best option would be to put a switch node in front of the Telegram node and duplicate the Telegram node (create one with 2 ids and one with 3).

You could use the expression {{item.json.id.length}} which will return the length (in your case 2 or 3) as the rule and connect your two Telegram nodes to the outputs of the switch node.

I hope this answers your question :slight_smile:

2 Likes

@one_juru impractical, but thanks

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