@@ -100,6 +100,32 @@ beginDialog:
100100 {Title: "Full Day Vacation", ReasonID: "Full Day_Vac", TimeOffTypeID: "ESS_Vacation_Hours"}
101101 )
102102
103+ # ================================================================
104+ # REASON MAPPING CONFIGURATION
105+ # Maps generic reason (Full Day / Half Day AM / Half Day PM) +
106+ # Time Off Type to the correct Workday ReasonID.
107+ # ReasonKey must match the dropdown values below.
108+ # TimeOffTypeID must match the time off type dropdown values.
109+ # ================================================================
110+ - kind : SetVariable
111+ id : set_time_off_reason_config
112+ variable : Topic.TimeOffReasonConfig
113+ value : |-
114+ =Table(
115+ {ReasonKey: "full_day", TimeOffTypeID: "ESS_Floating_Holiday_Hours", ReasonID: "full_day_floating"},
116+ {ReasonKey: "half_day_am", TimeOffTypeID: "ESS_Floating_Holiday_Hours", ReasonID: "half_day_am_floating"},
117+ {ReasonKey: "half_day_pm", TimeOffTypeID: "ESS_Floating_Holiday_Hours", ReasonID: "half_day_pm_floating"},
118+ {ReasonKey: "full_day", TimeOffTypeID: "ESS_Comp_Off", ReasonID: "Full day-COI"},
119+ {ReasonKey: "half_day_am", TimeOffTypeID: "ESS_Comp_Off", ReasonID: "Half day AM-COI"},
120+ {ReasonKey: "half_day_pm", TimeOffTypeID: "ESS_Comp_Off", ReasonID: "Half day PM-COI"},
121+ {ReasonKey: "full_day", TimeOffTypeID: "ESS_Sick_Time_Off", ReasonID: "Full day_Sick_IN"},
122+ {ReasonKey: "half_day_am", TimeOffTypeID: "ESS_Sick_Time_Off", ReasonID: "Half day AM_Sick_IN"},
123+ {ReasonKey: "half_day_pm", TimeOffTypeID: "ESS_Sick_Time_Off", ReasonID: "Half day PM_Sick_IN"},
124+ {ReasonKey: "full_day", TimeOffTypeID: "ESS_Vacation_Hours", ReasonID: "Full Day_Vac"},
125+ {ReasonKey: "half_day_am", TimeOffTypeID: "ESS_Vacation_Hours", ReasonID: "Half Day_AM_Vac"},
126+ {ReasonKey: "half_day_pm", TimeOffTypeID: "ESS_Vacation_Hours", ReasonID: "Half Day_PM_Vac"}
127+ )
128+
103129 # ================================================================
104130 # LEAVE TYPE CONFIGURATION
105131 # Edit keywords below to customize how user phrases map to leave types.
@@ -372,13 +398,11 @@ beginDialog:
372398 style: "compact",
373399 isRequired: true,
374400 errorMessage: "Please select a reason.",
375- choices: ForAll(
376- Topic.TimeOffReasonConfig,
377- {
378- title: Title,
379- value: ReasonID
380- }
381- )
401+ choices: [
402+ { title: "Full Day", value: "full_day" },
403+ { title: "Half Day AM", value: "half_day_am" },
404+ { title: "Half Day PM", value: "half_day_pm" }
405+ ]
382406 },
383407 {
384408 type: "Input.Text",
@@ -564,6 +588,12 @@ beginDialog:
564588 # V3: Build list of dates and pass to Plugin
565589 # ========================================================
566590
591+ # Map selected Time Off Type + Reason to Workday ReasonID
592+ - kind : SetVariable
593+ id : resolve_reason_id
594+ variable : Topic.resolvedReasonID
595+ value : =LookUp(Topic.TimeOffReasonConfig, ReasonKey = Topic.timeOffReason && TimeOffTypeID = Topic.timeOffType).ReasonID
596+
567597 - kind : SetVariable
568598 id : set_time_off_comment
569599 variable : Topic.timeOffComment
@@ -629,7 +659,15 @@ beginDialog:
629659 displayName : Submit Multi-Day Time Off Request
630660 input :
631661 binding :
632- parameters : ="{""params"":[{""key"":""{Employee_ID}"",""value"":""" & Global.ESS_UserContext_Employee_Id & """},{""key"":""{timeoff_Dates}"",""value"":""" & Topic.dateList & """},{""key"":""{timeoff_Time_Off_Type}"",""value"":""" & Topic.timeOffType & """},{""key"":""{timeoff_Hours_Per_Day}"",""value"":""" & Topic.hoursPerDay & """},{""key"":""{timeoff_Comment}"",""value"":""" & Topic.timeOffComment & """},{""key"":""{timeoff_Reason}"",""value"":""" & Topic.timeOffReason & """}]}"
662+ parameters : |-
663+ ="{""params"":[" &
664+ "{""key"":""{Employee_ID}"",""value"":""" & Global.ESS_UserContext_Employee_Id & """}," &
665+ "{""key"":""{timeoff_Dates}"",""value"":""" & Topic.dateList & """}," &
666+ "{""key"":""{timeoff_Time_Off_Type}"",""value"":""" & Topic.timeOffType & """}," &
667+ "{""key"":""{timeoff_Hours_Per_Day}"",""value"":""" & Topic.hoursPerDay & """}," &
668+ "{""key"":""{timeoff_Comment}"",""value"":""" & Topic.timeOffComment & """}," &
669+ "{""key"":""{timeoff_Reason}"",""value"":""" & Topic.resolvedReasonID & """}" &
670+ "]}"
633671 scenarioName : msdyn_HRWorkdayAbsenceEnterTimeOff_MultiDay
634672
635673 dialog : msdyn_copilotforemployeeselfservicehr.topic.WorkdaySystemGetCommonExecution
@@ -785,7 +823,7 @@ beginDialog:
785823 },
786824 {
787825 type: "TableCell",
788- items: [{ type: "TextBlock", text: Coalesce(LookUp( Topic.TimeOffReasonConfig, ReasonID = Topic.timeOffReason).Title , Topic.timeOffReason), wrap: true }]
826+ items: [{ type: "TextBlock", text: Switch( Topic.timeOffReason, "full_day", "Full Day", "half_day_am", "Half Day AM", "half_day_pm", "Half Day PM" , Topic.timeOffReason), wrap: true }]
789827 }
790828 ]
791829 },
0 commit comments