Hi there, it it possible to ad logic to a response header in a web hook? And if so, how?
I would like to check if there’s a variable and if not provide a default value, so
{{$json["filename"]? $json["filename"] :"default"}}
Thanks in advance.
Hi there, it it possible to ad logic to a response header in a web hook? And if so, how?
I would like to check if there’s a variable and if not provide a default value, so
{{$json["filename"]? $json["filename"] :"default"}}
Thanks in advance.
From looking at your other thread it seems you have already figured out this part
You could also use an even shorter variant of this:
{{$json["filename"] || "default"}}
This uses JavaScript’s short-circuiting logic for the OR operator (||
). If $json["filename"]
already returns a truthy value, the part after the ||
isn’t evaluated. But if $json["filename"]
returns something falsy (for example because no filename was provided by the previous node), "default"
is returned.