Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 98 additions & 1 deletion EmployeeSelfServiceAgent/Workday/ManagerScenarios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,105 @@ search_exclude: false
---
# Workday Manager Scenarios

Copilot Studio topics for manager self-service actions in Workday.
Copilot Studio topics for manager self-service actions in Workday. Topics for a Workday Manager's direct reports must cover all of the supervisory organizations that a manager may have. This requires a list of "supervisory organization IDs" which is provided in the Workday Set User Context topic and backed by a separate SOAP template.

Modify the Workday Set User Context topic with the following:

```
- kind: BeginDialog
id: aV1Wue
input:
binding:
parameters: ="{""params"":[{""key"":""{Employee_ID}"",""value"":""" & Global.ESS_UserContext_Employee_Id & """},{""key"":""{As_Of_Effective_Date}"",""value"":"""& Text(Today(), "yyyy-MM-dd") &"""}]}"
scenarioName: msdyn_HRWorkdayHCMEmployeeGetData

dialog: msdyn_copilotforemployeeselfserviceit.topic.WorkdaySystemGetCommonExecution
output:
binding:
errorResponse: Topic.errorResponse
isSuccess: Topic.isSuccess
workdayResponse: Topic.workdayResponse

- kind: ParseValue
id: 9dxmb5
variable: Topic.parsedWorkerData
valueType:
kind: Record
properties:
EmploymentData:
type:
kind: Table
properties:
Organization_Role_Data:
type:
kind: Record
properties:
Organization_Role:
type:
kind: Record
properties:
Organization_Role_Data:
type:
kind: Table
properties:
Assignment_From: String
Effective_Date: String
Role_Assigner_Reference:
type:
kind: Record
properties:
@Descriptor: String
ID:
type:
kind: Table
properties:
@type: String
"#text": String

Organization_Role_Reference:
type:
kind: Record
properties:
@Descriptor: String
ID:
type:
kind: Table
properties:
@type: String
"#text": String

value: =Topic.workdayResponse

- kind: SetVariable
id: setVariable_VMzjYp
variable: Global.Manager_Supervisory_OrgIds
value: |-
=Concat(
ForAll(
First(
Filter(
Topic.parsedWorkerData.EmploymentData,
Organization_Role_Data.Organization_Role.Organization_Role_Reference.'@Descriptor' = "Manager"
)
).Organization_Role_Data.Organization_Role.Organization_Role_Data,
First(
Filter(
Role_Assigner_Reference.ID,
'@type' = "Organization_Reference_ID"
)
).'#text'
),
Value,
","
)
```

Add the the [msdyn_HRWorkdayHCMEmployeeGetData](./msdyn_HRWorkdayHCMEmployeeGetData) SOAP template to the ESS template configuration.

| Folder | Description |
| --- | --- |
| [WorkdayGetManagerReporteesTimeInPosition/](./WorkdayGetManagerReporteesTimeInPosition/) | View reportees' time in position |
| [WorkdayManagersdirect-CompanyCode](./WorkdayManagersdirect-CompanyCode/) | View reportees' company code details |
| [WorkdayManagersdirect-CostCenter](./WorkdayManagersdirect-CostCenter/) | View reportees' cost center details |
| [WorkdayManagersdirect-Jobtaxanomy](./WorkdayManagersdirect-Jobtaxanomy/) | View details on reportees' job title, position, and other classifications |
| [WorkdayManagerServiceAnniversary](./WorkdayManagerServiceAnniversary/) | View details on reportees' upcoming anniversaries |
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ search_exclude: false
# Workday Get Manager Reportees Time In Position

## Overview
This scenario enables managers to view their direct reports along with how long each employee has been in their current position. It retrieves team member information from Workday HCM and calculates the time in position for each reportee.
This scenario enables managers to view their direct reports along with how long each employee has been in their current position. For each supervisory organization, it retrieves team member information from Workday HCM and calculates the time in position for each reportee. The columns displayed can be altered by updating the topic's Model Description section.

## Files

Expand All @@ -17,7 +17,9 @@ This scenario enables managers to view their direct reports along with how long
## Prerequisites

### Global Variables Required
- `Global.ESS_UserContext_ManagerOrganizationId` - The manager's organization ID in Workday (used to filter direct reports)
- Check the `ManagerScenarios` folder for more details on prerequisites.
- `msdyn_HRWorkdayHCMEmployeeGetData` - A SOAP template for retrieving the Workday supervisory organization IDs for a manager
- `Global.Manager_Supervisory_OrgIds` - A list of all of the Workday supervisory organization IDs of a manager

### Workday API
- **Service**: Human_Resources
Expand Down Expand Up @@ -81,30 +83,27 @@ The XML template is optimized for performance by:
1. **Import the Topic**: Import `topic.yaml` into your Copilot Studio agent
2. **Add XML Template**: Upload `msdyn_GetManagerReportees.xml` to your Workday connector configuration
3. **Configure Connection**: Ensure your Workday connector connection reference is properly set in the topic
4. **Set Global Variable**: Make sure `Global.ESS_UserContext_ManagerOrganizationId` is populated (typically from user authentication context)
4. **Set Global Variable**: Make sure `Global.Manager_Supervisory_OrgIds` is populated (typically from user context setup)

## Model Instructions

The topic includes model instructions for the AI to:
- Display results as a nested markdown list
- Format Time in Position clearly
- Show Name, Job Title, Time in Position, Start Date, and Status for each reportee
- Show Name, Job Title, Time in Position and Status for each reportee
- Sort or group results based on user's question context

## Example Output

When a manager asks "Show me my team's time in position", the agent displays:

```
Here are your direct reports and their time in current position:

- **John Smith** - Senior Developer
- Time in Position: 2 years, 5 months, 12 days
- Position Start: 2022-07-15
- Status: Active
# Team roles and time in position
Here's a list of your team members and how long they've been in their positions. I pulled this from Workday, an HR platform your company uses.

- **Jane Doe** - Product Manager
- Time in Position: 1 year, 2 months, 3 days
- Position Start: 2023-10-20
- Status: Active
```
> | Name | Title | Time in Position | Status |
> | ------------- | ------------- | ------------- | ------------- |
> | Jane Doe | Sales Solution Consultant | 8 months 28 days | Active
> | John Smith | Sales Solution Consultant | 7 months 5 days | Active
> | Jack Doe | Sales Solution Consultant | 7 months 28 days | Active
>
> If you need more details about a specific team member’s role or tenure, just let me know!
Loading