Log PTO requests from Teams to SQL Server

DatabaseMarketing

What it does

When someone runs the PTO command in Teams, this automation queries SQL Server for employee data. It posts a reply in the same conversation so the person knows their request was logged.

Who it's for

HR teams who need to record PTO requests from Teams without opening SQL Server or another system.

How teams use this

Log PTO without leaving Teams

Submit a PTO request from Teams using the command, and get confirmation that it was recorded in SQL Server. The team sees the request in the channel thread.

Check PTO balance before requesting

Add a balance lookup condition so the response shows remaining PTO days. The automation queries the employee's current balance in SQL Server before posting the reply.

Route requests to a manager approval channel

Retarget this automation to post PTO requests to a separate manager channel for review instead of replying in the original Teams conversation. The command and SQL query stay the same.

Filter requests by department

Set a condition in the SQL query to only log PTO requests for employees in a specific department. The Teams command and reply flow remain unchanged.

How it works

  1. Receive the PTO command. Someone types the PTO command in a Teams channel or direct message with details like dates and reason for the absence.
  2. Query SQL Server for employee data. Run a custom SQL query in SQL Server to fetch the employee record, PTO balance, and any existing time-off history for validation.
  3. Post the response in Teams. Reply in the same Teams conversation so the person knows their PTO request was logged and the SQL Server record was updated.