---
title: Common Examples
slug: common-examples
createdAt: 2026-01-27T02:52:44.361Z
---

Activate expressions are used to retrieve data, perform comparisons, and manipulate dates and strings within Activate products. This article provides common examples and explanations to help you understand how expressions are structured and where they can be applied.

# Retrieve user attributes

Use expressions to access properties related to the current user.

:::BlockQuote
\=/user/roles/Departments/0/Name
:::

Returns the name of the user’s department.

# Compare job data values

Expressions can evaluate conditions using job argument data.

:::BlockQuote
\=eval(=//Job/data/owner1 != =//Job/data/owner2)
:::

Checks whether the two job owners defined in the job data are different.

# Date calculations

Activate expressions support date arithmetic and formatting.

:::BlockQuote
\=dateadd(=//System/Now, "=/securityGroup/CreateGroupType/ExpirationTime")
:::

Adds a specified expiration time to the current system date.

:::BlockQuote
\=dateadd(h, 24, =if(=/user/ExpiryTime \< =toDate("1/01/1970 12:00:00 AM"), =//System/Now, =/user/ExpiryTime))
:::

If the user expiry time is null, the current system date is used instead, and 24 hours are added.

# Role membership checks

You can verify whether a user is a member of a specific role.

:::BlockQuote
\=!IsInRole("Administrators")
:::

Checks that the current user is not a member of the Administrators role.

:::BlockQuote
\=IsInRole(=//Roles/System Roles/Service Desk, =//Job/SubmitUser)
:::

Checks whether the job submit user is a member of the Service Desk system role.

# Date formatting

Use the format function to display dates in a specific format.

:::BlockQuote
\=format("\{0\:dd/MM/yyyy}", =toDate(=//Job/data/connector/StartDate))
:::

Formats the connector start date as day, month, and year.

:::BlockQuote
\=format("\{0\:dd/MM/yyyy}", =//Job/maxExpiryDate)
:::

Formats the maximum expiry date using the same date format.
