# usermap(), usermapid(), usermapname()

Use the mapping established in Tools - User Map to map from a source user name or ID to a target user ID.

## Arguments

Argument | Data Type | Description
ID / Login / Name | string | The ID, login, or full user name of the user from the source database.
DefaultID | string | The ID of a user from the TARGET system to use as a default if a mapping for the source user is not found.

## Returns

The ID of the target user, or the default ID supplied. If no user is found and no default supplied, an error is thrown.

## Description

These functions use the user mapping established in Tools - User Map to map from a source user name or ID to the mapped target user. This ID can then be passed to functions such as slxSetOwner() or msSetOwner().

usermapid() and usermapname() are deprecated; use usermap().

You can provide the ID, login, or full user name to usermap().

The default ID is returned if the supplied ID or name is not found in the user map. If the default is not supplied, an empty string is returned.

## Examples

Example | Description
--- | ---
usermap(#sourceIDField) | Return the ID of the mapped user - throw an error if not found
usermap("FRED", "id001") | Look for the login ID of "FRED" in the user map, and return the ID of the mapped user if found. If not found, return "id001".

## See Also

slxSetOwner(), msSetOwner(), setAccpacUser(), User Map