> For the complete documentation index, see [llms.txt](https://fusionauth.io/docs/llms.txt)

# SCIM Group Response Converter Lambda

An overview of the SCIM Group Response Converter lambda.

# SCIM Group Response Converter Lambda

If you would like to convert an outgoing FusionAuth Group response into a SCIM Group, you must specify a lambda in the SCIM configuration. This lambda will be invoked after the Group was acted upon.

When you create a new lambda using the FusionAuth UI we will provide you an empty function for you to implement.

## Lambda Structure

If you are using the API to create the lambda you will need to ensure your function has the following signature:

```javascript
function convert(scimGroup, group, members, context) {
  // Lambda code goes here
}
```

This lambda must contain a function named `convert` that accepts the following parameters:

*   `scimGroup` - the SCIM Group object. You can modify this object.
*   `group` - the FusionAuth Group object. This object is read-only.
*   `members` - the members in this FusionAuth Group. This object is read-only.
*   `context` - Available since 1.64.0 - an object containing the context of the request, including access to [secrets](https://fusionauth.io/docs/extend/code/lambdas.md#secrets). This object is read-only.

The FusionAuth `group` object is well documented in the [Group API](https://fusionauth.io/docs/apis/groups.md) documentation. The `members` object is an array of `user` objects, well documented in the [User API](https://fusionauth.io/docs/apis/users.md). The SCIM Group object is a JavaScript object containing the SCIM Group response JSON payload. See [SCIM Group](https://datatracker.ietf.org/doc/html/rfc7643#section-4.2).

You may add or modify anything in the `scimGroup` object.

## Assigning The Lambda

Once a lambda is created, you must assign it to a Tenant. See the SCIM tab in the Tenant configuration.

## Default Lambda

A default SCIM Group Response Converter Lambda that converts an outgoing FusionAuth Group response to a SCIM Group is available and may be used or modified. The lambda function is documented below.

```javascript
function convert(scimGroup, group, members) {
  // Un-comment this line to see the group object printed to the event log
  // console.info(JSON.stringify(group, null, 2));

  // Set the outgoing displayName on the SCIM group using the FusionAuth group name.
  scimGroup.displayName = group.name;
}
```