# How can Postman compare the value of a written variable with the value from json?

**URL:** <https://community.postman.com/t/how-can-postman-compare-the-value-of-a-written-variable-with-the-value-from-json/14284>\
**Category:** Help Hub\
**Tags:** tests, json, api\
**Created:** [July 19, 2020, 4:40pm UTC](https://community.postman.com/t/how-can-postman-compare-the-value-of-a-written-variable-with-the-value-from-json/14284 "2020-07-19T16:40:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [July 19, 2020, 4:45pm UTC](https://community.postman.com/t/how-can-postman-compare-the-value-of-a-written-variable-with-the-value-from-json/14284/2 "2020-07-19T16:45:29Z")

</div>

Hey @alexei.taushkanov

The `{{...}}` syntax isn’t available in the sandbox to use directly in the `expect` statement like that.

You would need to use it like this:

`pm.expect(jsonData.id).to.eql(pm.environment.get("id_user"));`

Alternatively, that double curly brace syntax could be used like this:

`pm.expect(jsonData.id).to.eql(pm.environment.replaceIn("{{id_user}}"));`

---

_[View the full topic](https://community.postman.com/t/how-can-postman-compare-the-value-of-a-written-variable-with-the-value-from-json/14284)._
