(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

How to Start

  1. (Example) Create a Process-Based App for an Absence Request.

Procedure

  1. In the Process Builder, in the Activity Library, open the Database tab.

    Open Database tab
  2. On the Database tab, drag the Query Record activity onto your process.

    Drag Query Record activity
  3. On the General Configuration screen, in the Display Name field, enter Get Leave Information.

    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.


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

    Database Access Token
  7. In the Schema Name list, select dbo.

    dbo
  8. In the Table Name list, select Available_Leaves.

    Available Leaves
  9. In the Attribute Name and Queries field, click Add Add icon.
  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.


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

    Drag RemainingLeaves
  12. In the Data Type list, select String.

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

    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.