Http request variables in query parameters not updated

I have an issue with a workflow sending sms via a http request.

Here is the issues:

  • Slack message a send correctly
  • SMS via http request just send multiple version of item(0)

Hi @wieseljonas, welcome to the community!

I am sorry to hear you’re having trouble. What do you mean by item(0)? Are you passing on multiple items but the HTTP Request node only processes the first item?

Would you be able to share the settings and expressions you are using in your HTTP Request node as well as the input data it’s getting from the Message node in your screenshot (of course, anything confidential can be redacted, I am only interested in the data structure)?

Hi @MutedJam,

So slack node had no problem. And http node just sends x times the first item.

e.g Message item I have 8 different items

[
  {
    "type": "organiser",
    "user": {
      "first_name": "Stexxx",
      "last_name": "Mazxx",
      "language": "it",
      "emails": [
        {
          "email": "[email protected]",
          "primary": false
        },
      ],
      "phone_numbers": [
        {
          "number": "+417xxx",
          "primary": false,
          "verified": false
        }
      ]
    },
    "location": "Via bazz XXX - Switzerland",
    "when": "Tomorrow",
    "message": "PROMEMORIA: Domani lei ha un appuntamento per una valutazione immobiliare.\n\nContatto: XX Maffioli\XX: Via bazz 2 2,XXX , Tessin - Switzerland\nOrario: 10 novembre à 17:45\nTel: +XXX"
  }
]

Http node param expressions

message: {{$node["Message"].json["message"]}}
number: {{$node["Message"].json["user"]["phone_numbers"][0]["number"]}}

Thanks @wieseljonas! So the use of $node in this example would indeed be the culprit. The reason for this is that in your screenshot the Message node runs 8 times. $node will, however, always return the data of the last run.

So my suggestion would be to read the respective input data in your HTTP Request node so you don’t have to worry about that. You can pick it the right expression to do so in the expression editor under Input Data:

You could also write it manually - just replace {{$node["Message"].json["message"]}} with {{$json["message"]}}

Hope this helps!

Great that works. Very confused why behaviour was different for slack and http node though.

That’s odd indeed - are you by any chance using different expressions in your Slack node?

I wasn’t :wink: Thank you for your help! All my fault

Well, things can be tricky sometimes. I am just glad it’s sorted now, thanks so much for confirming!

1 Like