Variable values are not being saved when sending output from Python-based Scriptable tasks
search cancel

Variable values are not being saved when sending output from Python-based Scriptable tasks

book

Article ID: 391427

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

When sending to output to Variables from a Scriptable Task the resulting Variable returns the following values:

  • Blank
  • Not Set (in the case of strings)
  • [Properties] with no values (in the case of properties)

Environment

Aria Orchestrator 8.x

Aria Automation 8.x

Cause

This is caused by a syntax error in the output of the script.

Resolution

To resolve this issue, use the following generic scripting task as a reference on how to handle your output.  In this example, sending to an Output variable named "outputs" that is a Property-type variable.  The variable values for this would result in a properly saved key:value of "status:done":

import json

def handler(context, inputs):
    jsonOut = json.dumps(inputs, separators=(',', ':'))

    outputs = {
      "status": "done"
    }

    return {
        "outputs": outputs
    }