Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Code Repo : https://github.com/NandanHegde15/MSFTFabric-Projects/blob/main/Vacation%20tracker/User%20Data%20Func...
Work Flow:
The code implements a Vacation Tracker workflow in Microsoft Fabric using User Defined Functions (UDFs).
It enables employees to submit and the Supervisor of that employee to approve, or reject vacation requests based on notification received. validates requests, checks public holidays, uses Azure OpenAI for recommendations, and sends notifications (via email + SMS).
Employee
│
│ (Submit Request: EmployeeId, StartDate, EndDate, Reason, Priority)
▼
Vacation Request UDF (vacation_tracker_request)
│
├─► Validate input (dates, reason, priority flag)
│
├─► SQL MERGE into VacationTracker
│
├─► Fetch Employee & Supervisor details from SQL
│
├─► Call Nager.Date API → Get holidays
│
├─► Query SQL → Past 12 months leave history
│
├─► Build prompt → Call Azure OpenAI GPT
│ │
│ └─► AI Suggestion (approve/reject context)
│
├─► Notify Supervisor:
│ • Email via Logic App (Approve / Reject buttons → Power BI report link)
│ • SMS via Twilio (if priority = Yes)
│
▼
Supervisor Action (Approve / Reject)
│
├─► If Approve → vacation_tracker_approval UDF
│ • Update SQL (status = Approved, reason, modified date)
│ • Notify Employee (Approval Email via Logic App)
│
└─► If Reject → vacation_tracker_rejection UDF
• Update SQL (status = Rejected, reason, modified date)
• Notify Employee (Rejection Email via Logic App)
Employee Page : Governed by RLS (Every employee would see his/her own details and can raise a Vacation request)
#Data Function 1
Supervisor would be able to see all details of his resources :
Supervisor would receive an email and in case of High priority receive an SMS with AI sugesstion based on past data and public holiday in range :
Based on Approve or Reject decision, Supervisor would be redirected to either Approval page or rejection page
#Data Function 2
#Data Function 3
Based on approval/Rejection, Backend database and the Direct Query report would be updated and the employee would receive an email notification :
This is good @NandanHegde