---
title: "Interface IActionScriptContext"
slug: "scripting--stylelabs.m.scripting.types.v1_0.action.iactionscriptcontext"
abstract: ""
---
# Interface IActionScriptContext

Defines an action script context.

## Namespace: StylelabsStylelabs.MStylelabs.M.ScriptingStylelabs.M.Scripting.TypesStylelabs.M.Scripting.Types.V1_0Action

## Assembly: Stylelabs.M.Scripting.Types.dll

## Syntax

```csharp
public interface IActionScriptContext
```

## Properties

### ChangeTracker

Gets used in combination with entity targets.

#### Declaration

```csharp
IChangeTracker ChangeTracker { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IChangeTracker](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.changetracking.ichangetracker.html) |  |

### Data

Gets arguments passed through the script. Should never be null.

#### Declaration

```csharp
JToken Data { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| JToken |  |

### [ExecutionEvent](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionevent.html)

Gets the execution event.

#### Declaration

```csharp
ExecutionEvent? ExecutionEvent { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ExecutionEvent](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionevent.html) |  |

### [ExecutionPhase](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionphase.html)

Gets the execution phase.

#### Declaration

```csharp
ExecutionPhase? ExecutionPhase { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ExecutionPhase](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionphase.html) |  |

### [ExecutionSource](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionsource.html)

Gets the execution source.

#### Declaration

```csharp
ExecutionSource ExecutionSource { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ExecutionSource](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionsource.html) |  |

### [ExecutionType](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executiontype.html)

Gets the type of execution.

#### Declaration

```csharp
ExecutionType ExecutionType { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [ExecutionType](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executiontype.html) |  |

### PropertyBag

Gets useful collection of string keyed string properties for case when [ExecutionSource](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.iactionscriptcontext.html) is [Trigger](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.executionsource.html). Use to store and retrieve information between trigger phases and in or out-of-process actions. Should never be null.

#### Declaration

```csharp
IPropertyBag PropertyBag { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [IPropertyBag](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.ipropertybag.html) |  |

#### Remarks

Note that for [ExecutionType](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.iactionscriptcontext.html) equals to ExecutionType.OutOfProcess the bag is read only.

### Result

Gets or sets output of the script, possibly null.

#### Declaration

```csharp
JToken Result { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| JToken |  |

### StatusCode

Gets or sets status code to return when executed through REST.

#### Declaration

```csharp
HttpStatusCode? StatusCode { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| HttpStatusCode |  |

### Target

Gets the target.

#### Declaration

```csharp
object Target { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| object |  |

### TargetId

Gets the target id.

#### Declaration

```csharp
long? TargetId { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| long |  |

### [TargetType](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.targettype.html)

Gets the target type.

#### Declaration

```csharp
TargetType? TargetType { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [TargetType](https://doc.sitecore.com/ch/en/developers/api-reference/scripting--stylelabs.m.scripting.types.v1_0.action.targettype.html) |  |

### TriggeringUserId

Gets if applicable and available an id of the user who caused event leading to this action or id of the user explicitly requesting the action.

#### Declaration

```csharp
long? TriggeringUserId { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| long |  |

## Methods

### ToString()

Converts to string.

#### Declaration

```csharp
string ToString()
```

#### Returns

| Type | Description |
| --- | --- |
| string | An string. |
