# How to use Params in "update" action

**URL:** <https://discuss.elastic.co/t/how-to-use-params-in-update-action/71650>\
**Category:** Elasticsearch\
**Created:** [January 15, 2017, 4:11pm UTC](https://discuss.elastic.co/t/how-to-use-params-in-update-action/71650 "2017-01-15T16:11:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeek](https://avatars.discourse-cdn.com/v4/letter/j/49beb7/32.png) [@jeek](https://discuss.elastic.co/u/jeek)\
**Post date:** [January 15, 2017, 4:11pm UTC](https://discuss.elastic.co/t/how-to-use-params-in-update-action/71650/1 "2017-01-15T16:11:20Z")

</div>

why does below two command always get an error respond? saying "variable is not defined". is ti something related to "params"?

note: in this index, \_id 124 has a field "age":20

curl -XPOST 'localhost:9200/website/blob/124/\_update?pretty' -d '{"script":"ctx.\_source.age += num", "params" : {"num" : 17}}'

curl -XPOST 'localhost:9200/website/blob/124/\_update' -d '{"script":"ctx.op = ctx.\_source.age == num ? 'delete' : 'none'", "params" : {"num" : 17}}'

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 12, 2017, 4:11pm UTC](https://discuss.elastic.co/t/how-to-use-params-in-update-action/71650/2 "2017-02-12T16:11:20Z")

</div>

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