Skip to content

FindPosition

Retrieves a list of available positions by name. Note that empty positions (those with no active employee assigned) are not included in the results. The Id property of each position corresponds to the column in the OrganizationUnitPosition table.

1
$Membership.FindPosition(position: string, organizationUnit: string, direction: ( `"Up"` | `"Down"` | `"None"` )):Array<Identity>

Parameters

string position
    The name of the position to find.

string organizationUnit
    Specifies the organization unit to limit the search to. Optional. Can be either the organization unit's ID (a GUID value) or its path (e.g., 'MyDepartment/MyChildUnit').

( "Up" | "Down" | "None" ) direction
    Specifies the search direction within the organization unit. Optional. If not specified, the search defaults to searching upwards in the hierarchy.

Returns

A list of positions matching the specified criteria.

Remarks

This function excludes empty positions, even if they are defined.
If an organization unit is provided, the position search is limited to that unit's scope. The direction parameter further refines the scope of the search within the specified organization unit.

Finding "Accounting Specialist" positions within the current organization:

1
var positions = $Membership.FindPosition('Accounting Specialist');

Finding "Accounting Specialist" positions within the "General Management" department:

1
var positions = $Membership.FindPosition('Accounting Specialist', 'General Management');

Finding "Accounting Specialist" positions within the "General Management/Accounting" department:

1
var positions = $Membership.FindPosition('Accounting Specialist', 'General Management/Accounting');

Finding "Accounting Specialist" positions within the "General Management/Accounting" department using the department's ID:

1
2
var organizationUnit = $Membership.FindIdentity('General Management/Accounting', 'OrganizationUnit');
var positions = $Membership.FindPosition('Accounting Specialist', organizationUnit);

See Also