Documentation issue with workday-writeback-tutorial.md
triagedassigned-to-authordoc-bugPri3entra-id/svcsaas-apps/subsvc
I believe there's a documentation issue within the tutorial for Workday Writeback. Under the [Timing the writeback for pre-hires](https://learn.microsoft.com/en-us/entra/identity/saas-apps/workday-writeback-tutorial#timing-the-writeback-for-pre-hires) section, item 4 incorrectly describes the logic of the provided expression.
IgnoreFlowIfNullOrEmpty(IIF(DateDiff("d", Now(), CDate([employeeHireDate])) >= 0, "", [userPrincipalName]))
The previous expression uses the DateDiff function to evaluate the difference between employeeHireDate and today's date in UTC obtained using Now function. **If employeeHireDate is greater than or equal to today's date, then it updates the UserID. Else it returns an empty value and the IgnoreFlowIfNullOrEmpty function excludes this attribute from Writeback.**
The bold highlights above document the inverse of the expression. Per the IIF function documentation, IIF(condition,**valueIfTrue,valueIfFalse**). Looking at the above expression, true would be "" and false would be [userPrincipalName]. The result of the evaluation is that userPrincipalName is not written back until **on** the hire date. Assumming the [employeeHireDate] is a date and has no time component, function CDate will return a time of 12:00:00AM. Thus if the function is triggered on [employeeHireDate], the 12AM time component from CDate will evaluate to < Now() and flow the [userPrincipalName].
---
#### Document Details
⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*
* ID: be669f51-5f2a-3e2b-ebd7-b5268e473044
* Version Independent ID: ec36c599-5a24-3317-bcd0-3c6f21902fd3
* Content: [Tutorial: Configure Workday writeback in Microsoft Entra ID - Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity/saas-apps/workday-writeback-tutorial#timing-the-writeback-for-pre-hires)
* Content Source: [docs/identity/saas-apps/workday-writeback-tutorial.md](https://github.com/MicrosoftDocs/entra-docs/blob/main/docs/identity/saas-apps/workday-writeback-tutorial.md)
* Service: **entra-id**
* Sub-service: **saas-apps**
* GitHub Login: @cmmdesai
* Microsoft Alias: **chmutali**
```[tasklist]
### Tasks
```
关闭于 2024-08-02 4 条评论