(Example) Configure a Database Activity to Get the Leave Information

To configure the Get Leave Information database activity to store the leave information, do the procedure in this topic.

Prerequisites

  • (Example) Create a Database Access Token.
  • A database with the name Absence_Request.
  • In the Absence_Request database, a table with the name Available_Leaves.
  • In the Available_Leaves table, columns named EmployeeID, RemainingLeaves, and Name.

Good to Know

Procedure

  1. In the Process Builder, go to the Activity Library, and open the Database tab.
  2. On the Database tab, drag the Query Record activity onto your process.
  3. On the General Configuration screen, in the Display Name field, enter Get Leave Information.


  4. Click Next.
  5. On the Query Record screen, click the SQL Command tab.

    For more information, refer to Get Data from a Database.



  6. On the SQL Command tab, in the Database list, select Database Access Token.


  7. In the Schema Name list, select dbo.


  8. In the Table Name list, select Available_Leaves.


  9. In the Attribute Name and Queries field, click Add .
  10. In the Sql Select Query field, enter a SQL SELECT query to get your data.

    Example:

    Select RemainingLeaves from Available_Leaves

    You can drag the column names from the Column Name field to create your SQL SELECT query.



  11. In the Attribute Name field, drag the column name RemainingLeaves from the Column Name field to store your data.


  12. In the Data Type list, select String.


  13. Click Back to go to the previous screen.
  14. Click Finish.

Download Files

This file has the database table used in this example. You can copy the contents of this table into your SQL database to test it.