> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/automations/global-actions-and-action-groups/basics/working-with-context-objects.md).

# Working with context objects

When you are working with Work-Relay Actions you can retrieve information about the current environment by using Work-Relay context objects. Context objects provides information about your source object, variables, current user, environment, etc. You can use this information to define complex logic on your Actions.

**The Work-Relay application supports the following set of context objects:**

### SourceObject

<details>

<summary>Show details</summary>

When creating an Action you can set a Source object - the type of the object which will be used in action.

When source object is selected you can use its fields to build formulas or to compare its values with query outputs.

Select Context Object Type (1).

![](/files/1c2ea0f7daccf7c867310825e760415e5a424ec6)

Now its fields (2) are available for using in formulas and queries. The application supports fields up to 4 level relationships.

</details>

### $System

<details>

<summary>Show details</summary>

**$System** object contains the organization context information.

![](/files/bfba18c8556d428847c0ea9a585c306ac3a682df)

* **Date -** value that indicating a current day.
* **DateTime -** value indicating current day and time.
* **Time -** value that indicates current time.
* **SessionID -** current APEX session ID value.
* **Timestamp -** current DateTime represented as a number of milliseconds since January 1, 1970, 00:00:00 GMT.
* **ForceBaseUrl -** stores URL value of the Salesforce instance.
* **ForceOrgUrl -** stores URL value of current Organization.
* **IsBatch -** returns true if the action is called from SF Batch.
* **IsFuture -** returns true if the action is called from "future" method.
* **IsQueueable -** returns true if the action is called from the SF Queue.
* **IsScheduled -** returns true if the action is called from the SF Scheduled job.

</details>

### $User

<details>

<summary>Show details</summary>

**$User** context object allows to work with logged in Salesforce user fields.

![](/files/4e7d31aa02908343eb56b04cc9acd17e7c5d4b27)

</details>

### $Variables

<details>

<summary>Show details</summary>

**$Variables** context object contains the current context variables set, that you pass to the action/group or defined in previous actions in case of Action Group.

{% hint style="info" %}
Note: not all variables used in action can be available there - it depends on if they were used somewhere in the action previously or not.
{% endhint %}

</details>

### $Environment

<details>

<summary>Show details</summary>

**$Environment** context object contains the form virtual fields.\
Example: `{$Environment.vf_phone}` - where "phone" is the form virtual field name.

</details>

### $Settings

<details>

<summary>Show details</summary>

**$Setting** custom object allows to use the Work-Relay custom settings (Salesforce Custom Settings).

![](/files/97cb8f54acdc04b3422b821dfaf77a4e7a105090)

</details>

### $Functions

<details>

<summary>Show details</summary>

This is not actually an object - selecting this option user can see a list of [functions](/automations/functions-and-formulas/functions-library.md) available.

</details>
