# operation: arcade.run
Description: Runs a stringified Arcade script. Web only.

- If only a string is passed in as an argument, it is interpreted as an   executeScript.
- If an executeScript is provided, the operation will return its result.
- If only a canExecute script is provided and it returns a truthy result,   the operation will return its input arguments.
- If a canExecuteScript returns a falsy value, the operation will throw a   `Cancellation`.

**Example:** Use an Arcade script to query a portal for a featureset, and return the area in square kilometers of the first feature. The output type of this operation is determined by the Arcade script, see https://developers.arcgis.com/arcade/function-reference/ for more information.

```
{
    "executeScript": "Area(First(FeatureSetByPortalItem(Portal(\"https://www.arcgis.com\"),\"6200db0b80de4341ae8ee2b62d606e67\",0,[\"*\"],true)),\"square-kilometers\");"
}
```

Inputs: `( RunArcadeArgs | string )`

RunArcadeArgs properties:
```json
{
  "arguments": {
    "description": "An arguments object that provides named variables and associated values, which can be referenced from within the executeScript and canExecuteScript. Note that context variables will be passed in if available under the well known arcade variable names: $feature, $features, $map, $layer and $featuremap which is a constructed Arcade dictionary that exposes a feature mapping dictionary keyed via feature source ID with the following values: id, title and features.\n\nNOTE: All variable keys must consist of only lowercase letters; camel-cased context variables will break the script when they are referenced at runtime."
  },
  "canExecuteScript": {
    "description": "The stringified Arcade script used to determine whether or not the executeScript can/should be run. If no executeScript is provided and the canExecuteScript returns a truthy value, the operation will return its input arguments; otherwise, if the canExecuteScript returns a falsy value, it will throw a {@link Cancellation}.",
    "type": "string"
  },
  "executeScript": {
    "description": "The stringified Arcade script to run. If this property is included, the operation will return the result of the script.",
    "type": "string"
  },
  "features": {
    "description": "Features to use for the command/operation."
  },
  "includeContext": {
    "description": "Whether to pass the operation context object into the script. If included, the context object uses the variable name $context.",
    "type": "boolean"
  },
  "includeWorkflowApplicationData": {
    "description": "Whether to pass the current workflow application state into the script. If included, the application state object uses the variable name $workflowdata.",
    "type": "boolean"
  },
  "layers": {
    "description": "Layer(s) to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  },
  "watchHandles": {
    "description": "Properties used to set a series of watch handles and/or event listeners on an item that will trigger the canExecuteChanged event for the 'arcade.run' operation.",
    "items": {
      "$ref": "#/definitions/WatchEventHandleProperties",
      "WatchEventHandleProperties": {
        "item": {
          "description": "The item whose properties will be watched for changes and/or events.",
          "isRequired": "true"
        },
        "watch": {
          "anyOf": [
            {
              "$ref": "#/definitions/WatchEventProperty"
            },
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/definitions/WatchEventProperty"
                  },
                  {
                    "type": "string"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "string"
            }
          ],
          "description": "One or more properties on the item that will be watched for changes and/or events. Any strings will be used as propertyPaths that will be watched for changes; for this to work, the item and all properties referenced within the path (except for the last) must implement {@link Observable}.",
          "isRequired": "true"
        }
      }
    },
    "type": "array"
  }
}
```

Outputs: `unknown`

---
