- 3 Minutes to read
- Print
- DarkLight
- PDF
Special Variables
- 3 Minutes to read
- Print
- DarkLight
- PDF
There are some special variables that contain information injected into a script if the script was executed by an event trigger.
Event Triggered Executed Special Variables
The following variables are available when a script is executed by an event trigger:
Variable Name | Type | Description |
---|---|---|
|
| Contains information about the event that triggered the script, such as the object name, the workspace id, the date/time, and the id and name of the person who triggered the script.
|
|
| The raw inbound JObject instance. The
|
|
| The fully qualified type of the inbound object instance. Useful for inspecting or comparing types for triggers that may have multiple return types based on the
|
|
| Provides the id of the script that is currently being executed. |
|
| Provides the event action. Some objects, like |
Example Usages
Example script that provides output from all special variables. Note that the output will indicate that the variable is unavailable if you try to execute this script manually:
if ($null -ne $ABVAREvent) {
Write-Output "ABVAREvent is available ($($ABVAREvent.GetType()))"
$ABVAREvent.ToString()
Write-Output ""
} else {
Write-Output "ABVAREvent is not available"
}
if ($null -ne $ABVARObject) {
Write-Output "ABVARObject is available ($($ABVARObject.GetType()))"
$ABVARObject.ToString()
Write-Output ""
} else {
Write-Output "ABVARObject is not available"
}
if ($null -ne $ABVARObjectType) {
Write-Output "ABVARObjectType is available ($($ABVARObject.GetType()))"
$ABVARObjectType.ToString()
Write-Output ""
} else {
Write-Output "ABVARObjectType is not available"
}
if ($null -ne $ABVARScriptId) {
Write-Output "ABVARScriptId is available ($($ABVARScriptId.GetType()))"
$ABVARScriptId
Write-Output ""
} else {
Write-Output "ABVARScriptId is not available"
}
if ($null -ne $ABVAREventAction) {
Write-Output "ABVAREventAction is available ($($ABVAREventAction.GetType()))"
$ABVAREventAction
Write-Output ""
} else {
Write-Output "ABVAREventAction is not available"
}
Sample output:
ABVAREvent is available (Newtonsoft.Json.Linq.JObject)
{
"Payload": {
"Id": 28641,
"DisplayValue": "UPDATE"
},
"Origin": null,
"Zone": 1,
"Action": 2,
"Object": "Contact",
"WorkspaceId": 922,
"CreatedOn": "2024-10-24T19:53:55.2958292+00:00",
"CreatedBy": {
"Id": "4d004c9a-03e3-073c-0f96-b0556bf6735d",
"DisplayValue": "Taylor Thompson"
},
"Message": "Contact 'UPDATE' (28641) updated"
}
ABVARObject is available (Newtonsoft.Json.Linq.JObject)
{
"ContactId": 28641,
"FirstName": "Aaron",
"LastName": "Gerard",
"FullName": "Aaron Gerard",
"EmailAddress": "agerratymn@merriam-webster.com",
"NameAndEmailAddress": "Aaron Gerard <agerratymn@merriam-webster.com>",
"PhoneNumber": null,
"TimeZoneIdentifier": "Central Standard Time",
"EnableNotifications": false,
"AllowPortalAccess": false,
"IsFavorite": false,
"NumberOfProjects": 0,
"CreatedByFullName": "Taylor Thompson",
"CreatedById": "4d004c9a-03e3-073c-0f96-b0556bf6735d",
"CreatedOn": "2023-02-23T13:38:16.2183354+00:00",
"CreatedBy": null,
"LastUpdatedByFullName": "Taylor Thompson",
"LastUpdatedById": "4d004c9a-03e3-073c-0f96-b0556bf6735d",
"LastUpdatedOn": "2024-10-24T19:53:55.1653167+00:00",
"LastUpdatedBy": null,
"Fields": []
}
ABVARObjectType is available (Newtonsoft.Json.Linq.JObject)
AgilityBlue.ViewModels.Workspace.ContactViewModel, AgilityBlue.ViewModels, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ABVARScriptId is available (string)
a54d24fd-b120-40e7-a7bf-0487c6a8dba7
ABVAREventAction is available (string)
UPDATE