---
title: Sample OGNL expressions
description: PingFederate provides an advanced option allowing administrators to map user attributes by way of an expression language. The following are sample OGNL expressions for common use case requirements with the PingFederate Box Connector. Learn more about enabling expressions in PingFederate in Enabling and disabling expressions in the PingFederate documentation.
component: box
page_id: box:setup:pf_box_connector_sample_ognl_expressions
canonical_url: https://docs.pingidentity.com/integrations/box/setup/pf_box_connector_sample_ognl_expressions.html
revdate: June 27, 2024
section_ids:
  example: Example
  lastname-firstname: Lastname, Firstname
  lastname-firstname-department: Lastname, Firstname (Department)
  remove-domain-from-email-address: Remove Domain from Email Address
---

# Sample OGNL expressions

PingFederate provides an advanced option allowing administrators to map user attributes by way of an expression language. The following are sample OGNL expressions for common use case requirements with the PingFederate Box Connector. Learn more about enabling expressions in PingFederate in [Enabling and disabling expressions](https://docs.pingidentity.com/pingfederate/latest/administrators_reference_guide/pf_enable_disable_express.html) in the PingFederate documentation.

The below sample expressions are intended for use with the **Personal Folder Name** attribute. This can be configured under **SP Connection > Configure Channels > Channel > Attribute Mapping** when **Create Personal Folders** is enabled. To configure the **Personal Folder Name** attribute, select **Edit**, add all necessary attributes for the evaluation of the expression, and configure the expression.

## Example

### Lastname, Firstname

The following expression would produce the format `Collins, Audrey` for the user Audrey Collins.

```
#lastname = #this.get("sn").toString(),
#firstname = #this.get("givenName").toString(),
#foldername = #lastname + ", " + #firstname
```

### Lastname, Firstname (Department)

The following expression would produce the format `Collins, Audrey (Sales)`, where the user Audrey Collins works in the Sales department.

```
#lastname = #this.get("sn").toString(),
#firstname = #this.get("givenName").toString(),
#department = #this.get("department").toString(),
#foldername = #lastname + ", " + #firstname + " (" + #department + ")"
```

### Remove Domain from Email Address

The following expression would produce the format `acollins`, where the user Audrey Collins has an email address `acollins@example.com`.

```
#this.get("mail").toString().split("@")[0]
```
