Nesting IF in expression and string concatenation

Hey I have a json like

{
"quantitiesAligned": false,
"quantities": {
   "Movement Quantity": 3197945
 }
}

I have an expression like

"text": "• Quantities aligned: {{$node["Get pipeline stats"].json["quantitiesAligned"] ? ':white_check_mark:' : ':x:'}}"

I’d like to change it so in case quantitiesAligned is false it’d print also the $quantities.Movement Quantity. I created an expression like

"text": "• Quantities aligned: {{$node["Get pipeline stats"].json["quantitiesAligned"] ? ':white_check_mark:' : ':x:'}}{{$node["Get pipeline stats"].json["quantitiesAligned"] ? '' : ('\n*' + $node["Get pipeline stats"].json["quantities"]["Movement Quantity"] + '*')}}"

but it’s not working - how to fix it ? Especially in if-else when using node value how to concat a string ?

Hi @clydeBarrow, welcome to the community :tada:

I am sorry to hear you’re having trouble. I’ve tried this on my end and it seems to work as expected in this dummy workflow I’ve built:

The only change I have made is replacing the node name in your expression to read from my Mock data instead. This was on [email protected]. Could you confirm which error exactly you are seeing and also share a workflow using which this problem can be reproduced? This doesn’t have to be your full original workflow, just enough to see the error will be fine.

1 Like

@MutedJam Hey, Thanks for help, you were right it was working.
Kind regards

1 Like

Awesome, glad to hear. Thx so much for confirming!