Principal operations and scripts

The principal operations can be used with any Object Type for the script.

The object contains the user or group data, depending on the context of how the script is run. You can access principal data but not change it. You can use it to access the information of the user or group who caused a rule to run.

The type cannot not be assumed to be user or group. Therefore, check the type before you use it to assign ownership or members to an object.

Type principal. to access the types of data, which is described in the following table.

Object Operations
id

Returns the ID of the user or group.

name

Returns the API name of the user or group. For a user, it is an email address.

display_name

Displays the name of the user or group. For a user, it is in the format, FirstName LastName.

type

Returns the user or group.