# How to correctly use $evaluateExpression

**URL:** <https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042>\
**Category:** Questions\
**Created:** [August 21, 2025, 12:05pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042 "2025-08-21T12:05:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ergs0204](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ergs0204/32/60459_2.png) [@ergs0204](https://community.n8n.io/u/ergs0204)\
**Post date:** [August 21, 2025, 12:05pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/1 "2025-08-21T12:05:09Z")

</div>

## Describe the problem/error/question

I’m testing `$evaluateExpression` in **n8n**.

The goal:

- Store some JSON data (e.g. `{"name":"John"}`).

- Store an expression string (e.g. `"hi {{ $('set data').item.json.name }}"`).

- Later dynamically evaluate the expression string using `$evaluateExpression`in JS code block.

In production, the `data` and `expression` will both be **strings coming from upstream nodes** , so I need `$evaluateExpression` to resolve them dynamically.

## What is the error message (if any)?

None

## Please share your workflow

## Share the output returned by the last node

{“result”: null}

## Information on your n8n setup

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![withabdul](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/withabdul/32/179439_2.png) [@withabdul](https://community.n8n.io/u/withabdul)\
**Post date:** [August 21, 2025, 12:12pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/2 "2025-08-21T12:12:00Z")

</div>

[Evaluations | n8n Docs](https://docs.n8n.io/advanced-ai/evaluations/overview/)

You can follow that instructions

---

<div class="post-metadata">

**Author:** ![ergs0204](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ergs0204/32/60459_2.png) [@ergs0204](https://community.n8n.io/u/ergs0204)\
**Post date:** [August 21, 2025, 1:00pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/3 "2025-08-21T13:00:50Z")

</div>

Thanks for reply. im not trying to evaluate this workflow but trying to use $evaluateExpression in code block.  
I’ve tried this doc [Convenience methods | n8n Docs](https://docs.n8n.io/code/builtin/convenience) but didn’t help.

---

<div class="post-metadata">

**Author:** ![withabdul](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/withabdul/32/179439_2.png) [@withabdul](https://community.n8n.io/u/withabdul)\
**Post date:** [August 21, 2025, 1:38pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/4 "2025-08-21T13:38:30Z")

</div>

Ah sorry I dont get what u mean, in my n8n it’s working fine btw.

---

<div class="post-metadata">

**Author:** ![ergs0204](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ergs0204/32/60459_2.png) [@ergs0204](https://community.n8n.io/u/ergs0204)\
**Post date:** [August 21, 2025, 1:50pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/5 "2025-08-21T13:50:56Z")

</div>

it output `{“result”: “hi John”}`?

---

<div class="post-metadata">

**Author:** ![withabdul](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/withabdul/32/179439_2.png) [@withabdul](https://community.n8n.io/u/withabdul)\
**Post date:** [August 21, 2025, 2:03pm UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/6 "2025-08-21T14:03:27Z")

</div>

Yes, exactly.  
Which version in n8n are u?

---

<div class="post-metadata">

**Author:** ![ergs0204](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/ergs0204/32/60459_2.png) [@ergs0204](https://community.n8n.io/u/ergs0204)\
**Post date:** [August 23, 2025, 4:02am UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/7 "2025-08-23T04:02:11Z")

</div>

version : 1.107.3  
Using docker with env  
`-e N8N_RUNNERS_ENABLED=true `  
`-e N8N_SECURE_COOKIE=false `  
`-e DB_SQLITE_POOL_SIZE=1`

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [November 21, 2025, 4:02am UTC](https://community.n8n.io/t/how-to-correctly-use-evaluateexpression/173042/8 "2025-11-21T04:02:28Z")

</div>

Closed on November 21, 2025, 4:02am UTC

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