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
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,7 @@ 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)
- `Global.Manager_Supervisory_OrgIds` - A list of all of the Workday supervisory organization IDs of a manager (used to filter direct reports)

### Workday API
- **Service**: Human_Resources
Expand Down Expand Up @@ -81,30 +81,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!
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ modelDescription: |-
For info on all direct reports time in position: Display in Table
Heading - "Team roles and time in position"
Verbatim line after heading: "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."
Table columns: Name, Title, Time in Position
Table columns: Name, Title, Time in Position, Status

Common Rules ALWAYS FOLLOW:
- ALWAYS add large sized heading with sentence case
Expand All @@ -23,102 +23,135 @@ beginDialog:
intent: {}
actions:
- kind: BeginDialog
id: jJpz3n
displayName: Redirect to Workday Get Common Execution
input:
binding:
parameters: ="{""params"":[{""key"":""{Manager_Org_ID}"",""value"":""" & Global.ESS_UserContext_ManagerOrganizationId & """}]}"
scenarioName: msdyn_GetManagerReportees

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

- kind: ParseValue
id: aXVFNu
displayName: Parse value to a record
variable: Topic.workdayResponseRecord
valueType:
kind: Record
properties:
BusinessTitle:
type:
kind: Table
properties:
Value: String

EmployeeID:
type:
kind: Table
properties:
Value: String

HireDate:
type:
kind: Table
properties:
Value: String

JobProfile:
type:
kind: Table
properties:
Value: String

Location:
type:
kind: Table
properties:
Value: String

Name:
type:
kind: Table
properties:
Value: String

PositionStartDate:
type:
kind: Table
properties:
Value: String

Status:
type:
kind: Table
properties:
Value: String

WorkerType:
type:
kind: Table
properties:
Value: String

value: =Topic.workdayResponse
id: WmAHrc
displayName: Check manager criteria
dialog: msdyn_copilotforemployeeselfservicehr.topic.WorkdayManagerCheck

- kind: SetVariable
id: setVariable_OBjpUF
variable: Topic.workdayAllOrgResponseTable
value: =[]

- kind: Foreach
id: foreach_niaz95
items: =Split(Global.Manager_Supervisory_OrgIds, ",")
value: Topic.SupOrgId
index: init:Topic.LoopIndex1
actions:
- kind: BeginDialog
id: jJpz3n
displayName: Redirect to Workday Get Common Execution
input:
binding:
parameters: ="{""params"":[{""key"":""{Manager_Org_ID}"",""value"":""" & Topic.SupOrgId & """}]}"
scenarioName: msdyn_GetManagerReportees

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

- kind: ParseValue
id: aXVFNu
displayName: Parse value to a record
variable: Topic.workdayResponseRecord
valueType:
kind: Record
properties:
BusinessTitle:
type:
kind: Table
properties:
Value: String

EmployeeID:
type:
kind: Table
properties:
Value: String

HireDate:
type:
kind: Table
properties:
Value: String

JobProfile:
type:
kind: Table
properties:
Value: String

Location:
type:
kind: Table
properties:
Value: String

Name:
type:
kind: Table
properties:
Value: String

PositionStartDate:
type:
kind: Table
properties:
Value: String

Status:
type:
kind: Table
properties:
Value: String

WorkerType:
type:
kind: Table
properties:
Value: String

value: =Topic.workdayResponse

- kind: SetVariable
id: setVariable_ztXmui
displayName: Extract data to table
variable: Topic.workdayResponseTable
value: |-
=ForAll(
Sequence(CountRows(Topic.workdayResponseRecord.EmployeeID)),
{
EmployeeID: Last(FirstN(Topic.workdayResponseRecord.EmployeeID, Value)).Value,
Name: Last(FirstN(Topic.workdayResponseRecord.Name, Value)).Value,
BusinessTitle: Last(FirstN(Topic.workdayResponseRecord.BusinessTitle, Value)).Value,
WorkerType: Last(FirstN(Topic.workdayResponseRecord.WorkerType, Value)).Value,
JobProfile: Last(FirstN(Topic.workdayResponseRecord.JobProfile, Value)).Value,
Location: Last(FirstN(Topic.workdayResponseRecord.Location, Value)).Value,
PositionStartDate: Last(FirstN(Topic.workdayResponseRecord.PositionStartDate, Value)).Value,
HireDate: Last(FirstN(Topic.workdayResponseRecord.HireDate, Value)).Value,
Status: If(Last(FirstN(Topic.workdayResponseRecord.Status, Value)).Value = "1", "Active", "Inactive")
}
)

- kind: Foreach
id: foreach_rows_in_org
items: =Topic.workdayResponseTable
value: Topic.employeeRow
actions:
- kind: EditTableV2
id: editTableV2_AddWorkerRow
itemsVariable: Topic.workdayAllOrgResponseTable
changeType:
kind: AddItemOperation
value: =Topic.employeeRow

- kind: SetVariable
id: setVariable_ztXmui
displayName: Extract data to table
id: setVariable_P41zFQ
variable: Topic.workdayResponseTable
value: |-
=ForAll(
Sequence(CountRows(Topic.workdayResponseRecord.EmployeeID)),
{
EmployeeID: Last(FirstN(Topic.workdayResponseRecord.EmployeeID, Value)).Value,
Name: Last(FirstN(Topic.workdayResponseRecord.Name, Value)).Value,
BusinessTitle: Last(FirstN(Topic.workdayResponseRecord.BusinessTitle, Value)).Value,
WorkerType: Last(FirstN(Topic.workdayResponseRecord.WorkerType, Value)).Value,
JobProfile: Last(FirstN(Topic.workdayResponseRecord.JobProfile, Value)).Value,
Location: Last(FirstN(Topic.workdayResponseRecord.Location, Value)).Value,
PositionStartDate: Last(FirstN(Topic.workdayResponseRecord.PositionStartDate, Value)).Value,
HireDate: Last(FirstN(Topic.workdayResponseRecord.HireDate, Value)).Value,
Status: If(Last(FirstN(Topic.workdayResponseRecord.Status, Value)).Value = "1", "Active", "Inactive")
}
)
value: =Topic.workdayAllOrgResponseTable

- kind: SetVariable
id: setVariable_AddTimeInPosition
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
nav_exclude: true
search_exclude: false
---
# Workday Get Manager Reportees Service Anniversaries
## Overview
For each of their supervisory organizations, this scenario enables managers to view their direct reports along with Service Anniversary details.

## Files

| File | Description |
|------|-------------|
| `topic.yaml` | Copilot Studio topic definition with trigger phrases and Power Fx logic |
| `msdyn_HRWorkdayHCMManagerServiceAnniversary.xml` | XML template for Workday Get_Workers API call |

## Prerequisites

### Global Variables Required
- `Global.Manager_Supervisory_OrgIds` - A list of all of the Workday supervisory organization IDs of a manager (used to filter direct reports)

### Workday API
- **Service**: Human_Resources
- **Operation**: Get_Workers
- **Version**: v41.0

## Scenario Details

### What It Does
1. Retrieves all employees in all supervisory organizations for the manager (all direct reports).
2. Extracts key employee information (Job Title, Business Title, etc.)
3. Presents results in a formatted table

### Trigger Phrases
- When are the service anniversaries of all my directs?
- What are the service anniversaries of my entire team?
- Show me the service anniversaries of my reports?

## Response Group Configuration

The XML template is optimized for performance by:
- **Including**: Reference, Personal Information, Employment Information
- **Excluding**: Compensation, Benefits, Documents, Photos, and other unnecessary data

## Setup Instructions

1. **Import the Topic**: Import `topic.yaml` into your Copilot Studio agent
2. **Add XML Template**: Upload `msdyn_HRWorkdayHCMManagerServiceAnniversary.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.Manager_Supervisory_OrgIds` is populated (typically from user context setup)

## Example Output

When a manager asks "Show me my team's service anniversaries", the agent displays:

> Here’s a summary of your team’s upcoming service anniversaries:
>
> | Employee Name | Hire Date | Upcoming Service Anniversary | Upcoming Milestone |
> | ------------- | ------------- | ------------- | ------------- |
> | John Doe | 2025-07-01 |2026-07-01 | 1 year |
> | Jane Doe | 2025-08-25 |2026-08-25 | 1 year |
> | John Smith | 2025-08-01 | 2026-08-01 | 1 year |

Loading