Help: Format The Watcher Email Body Section

Hi there:
I'm currently using this code {{ctx.payload.payload_result}} in my email body to print out the health check status but the format is not ideal (see below), is there a way I can organize it nicely(see proposed output)? Thanks so much.

"payload_result": {
          "summary": {
            "unavailable": {
              "system1-health-check-status": [
                "system1-host"
              ],
              "system2-health-check-status": [
                "system2-host"
              ],
              "system3-health-check-status": [
                "system3-host"
              ],
              "system4-health-check-status": [
                "system4-host"
              ],
              "system5-health-check-status": [
                "system5-host"
            }
         }
      }

Proposed Output:

system1-health-check-status
 -system1-host

system2-health-check-status
 -system2-host

system3-health-check-status
 -system3-host

system4-health-check-status
 -system4-host

system5-health-check-status
 -system5-host

You can loop through a list in your payload result and then do some formatting...

Can you share what you tried so far, because I am only seeing JSON here, which does not help too much from my perspective.

Thanks!

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