Reference Expression Editor Value instead of string

How do i get n8n to return the number not the string that is being used in the top box? I need the result to show the same number as the result in the second screenshot

Number Result
image

Not sure what is happening here. But you can put a + sign in front of a string to convert it to a number. This should work in most cases. But I am confused at what I am looking at here. :sweat_smile:

It looks like you are trying to pull out the expression from the parameter. If you want to return the value that expression resolves to, you’ll have to evaluate it using $evaluateExpression.

2 Likes

awesome, learned something new. Thanks. :+1:
No idea where I would ever use this but we will see. :slight_smile:

2 Likes

hmm i tried that and still am unable to get the result, its showing only the first character of the string, must be doing it wrong

My best guess is this is caused by the [0] that is included in the expression. Can you test without?

Ah sorry. Bad guess it was :sweat_smile:

I looked back at he original question. Is there a way to simply remove the = from the data before doing this evaluate function?

yeah, but doesnt help. tried that first

Ok, so I had some time to actually try this out.
Seems to work perfectly fine here.
Can you share your workflow?

2 Likes