Using 1 action's output result in another action

Hi all,
I am trying to extract the value from one action output and I want to use that result in the another action block. I am using the below watcher script to extract the value but with this I am not able to get the desired result.

{
  "trigger": {
    "schedule": {
      "interval": "5m"
    }
  },
  "input": {
    "search": {
      "request": {
        "body": {
          "size": 0,
          "query": {
            "bool": {
              "filter": {
                "range": {
                  "datetime": {
                    "gte": "{{ctx.trigger.scheduled_time}}||-5m",
                    "lte": "{{ctx.trigger.scheduled_time}}",
                    "format": "strict_date_optional_time||epoch_millis"
                  }
                }
              }
            }
          }
        },
        "indices": [
          "abc"
        ]
      }
    }
  },
  "condition": {
    "script": {
      "source": "if (ctx.payload.hits.total > params.threshold) { return true; } return false;",
      "params": {
        "threshold": 100
      }
    }
  },
  "actions": {
    "email_admin": {
      "email": {
        "profile": "standard",
        "from": "abc@abc.com",
        "to": ["xyz.lmn@abc.com"],
        "subject": "Test",
        "body": {
          "text": "Test for body"
        }
      }
    },
    "email_body_text": {
      "email": {
        "profile": "standard",
        "from": "abc@abc.co",
        "to": ["xyz.lmn@abc.com"],
        "subject": "Body Text from Previous Action",
        "body": {
          "text": "{{ctx.payload.actions.email.message.body.text}}"
        }
      }
    }
  }
}

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