# Watcher: How to execute "condition" after "transform"?

**URL:** <https://discuss.elastic.co/t/watcher-how-to-execute-condition-after-transform/257232>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [December 1, 2020, 3:52pm UTC](https://discuss.elastic.co/t/watcher-how-to-execute-condition-after-transform/257232 "2020-12-01T15:52:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kelk](https://discuss.elastic.co/u/kelk)\
**Post date:** [December 1, 2020, 3:52pm UTC](https://discuss.elastic.co/t/watcher-how-to-execute-condition-after-transform/257232/1 "2020-12-01T15:52:48Z")

</div>

in Elastic Watcher, we have a situation whereby I need to do some `transform` and calculate some value. Once calculating these values, I need to do the `condition` logic

But it seems like `condition` is executed BEFORE `transform`. Is there any way I can make the condition after transform? or any tips?

So currently i'm looking to do..

```auto
  "transform": {
      "script":
      """
      'someCalculation': 1000,
      """
   },
  "condition": {
    "compare": {
      "someCalculation": {
        "gt": 99
      }
    }
  }

```

but the `someCalculation` is NOT available for the condition

---

<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:** [December 29, 2020, 3:53pm UTC](https://discuss.elastic.co/t/watcher-how-to-execute-condition-after-transform/257232/2 "2020-12-29T15:53:01Z")

</div>

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