> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackone.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Workday WQL

> Workday query language (WQL) usage guide for StackOne integrations

## Overview

Workday Query Language (WQL) is a powerful capability that lets users run complex queries against Workday data structures.
This guide introduces using WQL within StackOne integrations so you can retrieve and shape Workday data effectively through custom reports.

## Key Features of WQL

* **Data retrieval**: Extract specific data sources and their fields from Workday's extensive datasets.
* **Flexible querying**: Construct queries to filter, sort, and aggregate Workday data.
* **Nested data access**: Access and work with nested data structures in Workday.

### Example Query

Example WQL query to retrieve workers and selected attributes:

```sql theme={null}
SELECT workdayID as Workday_ID, employeeID as Employee_ID, legalName_Title as Title, legalFirstName as First_Name, legalLastName as Last_Name, legalNameInGeneralDisplayFormat as Display_Full_Name, email_PrimaryHome as Personal_Email, email_PrimaryWork as Work_Email, phone_PrimaryHome as Personal_Phone_Number FROM allWorkers
```

<Note>
  Creating a custom report is optional for generating WQL (Workday Query Language). However, there are several ways to obtain WQL: <br />

  * **Custom Report Feature**: By using the custom report feature, users can more accurately tailor the data they wish to extract from the data source and then convert the report to WQL.<br />
  * **Standard Reports**: You can utilize existing standard reports and convert them directly to WQL. To do this, navigate to **Convert Report to WQL** and select the `Standard Report`.<br />
  * **Data Source Navigation**: You can also navigate to the Data Source using global search and access a specific data source (e.g., All Workers) to view the available data source fields. From there, you can form a WQL query according to the WQL syntax.
</Note>

## Create and View a Custom Report

<Steps>
  <Step title="Go to Create Custom Report">
    Search and navigate to the `Create Custom Report` task

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Accessing Report Designer" src="https://mintcdn.com/stackone-60/LrkeBwEC5Nz-uyqN/images/workday/wql/workday_wql_custom_create_report_1.png?fit=max&auto=format&n=LrkeBwEC5Nz-uyqN&q=85&s=b108e350e22dc6bce26c6d4fb702fbe0" width="548" height="124" data-path="images/workday/wql/workday_wql_custom_create_report_1.png" />
    </Frame>
  </Step>

  <Step title="Configure custom report">
    Follow these steps to configure the custom report:

    * **Report Name**: Must be unique within the tenant
    * **Report Type**: Select **Advanced**
    * **Optimised for Performance**: Tick this box to enhance performance
    * **Data Source**: Choose the appropriate data source based on the data you need (e.g. Workers for HCM reporting).

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Create Custom Report" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_create_custom_report.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=59053625c88a1196783e061d889f12da" width="1159" height="604" data-path="images/workday/wql/workday_wql_create_custom_report.png" />
    </Frame>

    Click `OK` to continue.

    Add and configure report fields:

    * Click the `+` icon to add a field.
    * Select a Business Object (e.g. Worker) in the **Business Object** column.
    * Choose the specific field (e.g. Employee ID) in the **Field** column.
    * Set aliases in **Column Heading Override** to ensure stable field names in API responses.

    <Note>
      The **Column Heading Override XML Alias** column will appear only after you enable **Enable As Web Service** under the Advanced tab and save the report. You can view this column when you return to edit the report.
    </Note>

    <Info>
      Add the following **field aliases** in your report. The aliases serve as stable identifiers for the API responses but the underlying fields must be properly configured.

      * Workday\_ID
      * Employee\_ID
      * Title
      * First\_Name
      * Last\_Name
      * Display\_Full\_Name
      * Personal\_Email
      * Work\_Email
      * Personal\_Phone\_Number
      * Work\_Phone\_Number
      * Gender
      * Ethnicity
      * Date\_Of\_Birth
      * Marital\_Status
      * Job\_Title
      * Company
      * Hire\_Date
      * Original\_Hire\_Date
      * Employment\_Status
      * Location
      * Employment\_Type
      * Manager
      * Cost\_Centers
      * National\_Identifier\_Numbers
      * Termination\_Date
      * Home\_Address
      * Home\_Address\_Country
      * Home\_Address\_Postal\_Code
      * Home\_Address\_State
      * Home\_Address\_City
      * Work\_Address
      * Work\_Address\_Country
      * Citizenships
      * Job\_Code
      * Effective\_Date
      * Grade
      * Benefits
      * Skills
    </Info>

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Fields and Aliases Settings" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_fields_aliases.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=4b086da9ed021a5729ef77e2887d4472" width="2283" height="1237" data-path="images/workday/wql/workday_wql_fields_aliases.png" />
    </Frame>
  </Step>

  <Step title="Configure report prompts">
    * Tick **Populate Undefined Prompt Defaults** to make prompt default fields visible in the report table. Once the `Prompt Defaults` grid is visible, the ticked **Populate Undefined Prompt Defaults** field will be unticked again.
    * Tick **Display Prompt Values in Subtitle** to enable prompt display.

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Prompts Settings" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_custom_report_prompt.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=82b263ab4ed628e6fe9338ba800591f1" width="1123" height="1088" data-path="images/workday/wql/workday_wql_custom_report_prompt.png" />
    </Frame>

    Click `OK` to save the report.
  </Step>

  <Step title="Go to View Custom Report">
    Search for `View Custom Report`.

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Search for View Custom Report" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_search_for_view_custom_report.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=a54d3fa33197e3de3f0afc5d7865fb6f" width="553" height="124" data-path="images/workday/wql/workday_wql_search_for_view_custom_report.png" />
    </Frame>

    select the report you just created, and then click `OK` to open it.

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Select Custom report to View" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_select_for_view_custom_report.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=5b66da0e0a1deaa20bd73484ab140dcd" width="630" height="310" data-path="images/workday/wql/workday_wql_select_for_view_custom_report.png" />
    </Frame>
  </Step>

  <Step title="Test Custom Report">
    Navigate to `Test` under the `Custom Report` menu via the 3-dot menu.

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Navigate to Test" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_navigate_to_test.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=a9f5ba42de9948529bd05f0d27832bc3" width="795" height="281" data-path="images/workday/wql/workday_wql_navigate_to_test.png" />
    </Frame>

    Click `OK` to test it.

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Click OK on Pop-up" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_click_ok_to_move_forward_to_test.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=42da9a635ceb65c4dc9abc6507aa1bf1" width="628" height="376" data-path="images/workday/wql/workday_wql_click_ok_to_move_forward_to_test.png" />
    </Frame>

    You will get some sample data based on the fields you configured in the custom report.

    <Frame>
      <img className="rounded-md" style={{ margin:"0 auto",border:"1px solid #efefef" }} alt="Sample Data from Custom Report" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_sample_data_from_custom_report.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=a62b75c7eec12ca1bfc2db2e74ef06c7" width="1540" height="482" data-path="images/workday/wql/workday_wql_sample_data_from_custom_report.png" />
    </Frame>
  </Step>
</Steps>

## Convert the Report to WQL in Workday

<Steps>
  <Step title="Go to Convert Reports to WQL">
    Use the global search bar to search for "Convert Reports to WQL".

    <Frame>
      <img src="https://mintcdn.com/stackone-60/LrkeBwEC5Nz-uyqN/images/workday/wql/workday_wql_convert_report_to_wql_5.png?fit=max&auto=format&n=LrkeBwEC5Nz-uyqN&q=85&s=d3b3e3a91247849da820b30882e3817e" alt="Global search for Convert Reports to WQL" style={{ maxHeight: '500px', width: 'auto' }} width="551" height="123" data-path="images/workday/wql/workday_wql_convert_report_to_wql_5.png" />
    </Frame>

    Select the custom report you created earlier in the [Create and View a Custom Report](#create-and-view-a-custom-report) step.

    <Frame>
      <img src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_crw_select_report_6.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=4286c6150d15fdf9a7bcdf107da61e77" alt="Select created custom report" style={{ maxHeight: '500px', width: 'auto' }} width="649" height="314" data-path="images/workday/wql/workday_wql_crw_select_report_6.png" />
    </Frame>

    Click `OK`.
  </Step>

  <Step title="Click `OK` to continue">
    <Frame>
      <img src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_click_to_continue.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=3a3e5fae89e28c0f00107021c1028b8e" alt="Click to continue without filter" style={{ maxHeight: '500px', width: 'auto' }} width="569" height="361" data-path="images/workday/wql/workday_wql_click_to_continue.png" />
    </Frame>
  </Step>

  <Step title="Get the generated WQL query">
    You are taken to a page showing the generated WQL query for your custom report.

    <Frame>
      <img src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_crw_generate_7.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=bf1e96ab89160e64a9e6ed1918f67b49" alt="Generated WQL Query" style={{ maxHeight: '500px', width: 'auto' }} width="738" height="272" data-path="images/workday/wql/workday_wql_crw_generate_7.png" />
    </Frame>

    Copy this WQL query and paste it into the `Employee WQL Query` field when connecting through the StackOne Connector Hub.

    <Note>
      WQL does not support calculated fields when converting custom reports to WQL.
    </Note>
  </Step>
</Steps>

## StackOne Configuration

To enable Workday WQL in StackOne, go to the HRIS category on the *Integrations* page and enable Workday WQL.

<Frame>
  <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Activate Workday" src="https://mintcdn.com/stackone-60/LrkeBwEC5Nz-uyqN/images/workday/wql/workday_wql_integration_config_8.png?fit=max&auto=format&n=LrkeBwEC5Nz-uyqN&q=85&s=7d591ba98e52ca66d5adb007f45f52e4" width="991" height="396" data-path="images/workday/wql/workday_wql_integration_config_8.png" />
</Frame>

Select `OAuth2` as the authentication type.

<Frame>
  <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Activate Workday" src="https://mintcdn.com/stackone-60/LrkeBwEC5Nz-uyqN/images/workday/wql/workday_wql_integration_workday_setup_form_9.png?fit=max&auto=format&n=LrkeBwEC5Nz-uyqN&q=85&s=1417d0830ef1f79d3dcbe6ea5992a328" width="534" height="629" data-path="images/workday/wql/workday_wql_integration_workday_setup_form_9.png" />
</Frame>

Click `Confirm` or `Save Changes` to enable the Workday integration, allowing users to link their accounts via the StackOne Connector Hub.

## ATS User Enablement

Users connect their Workday accounts through the StackOne Connector Hub by providing the WQL query generated in their Workday account.

<Frame>
  <img className="rounded-md" style={{ margin: '0 auto', border: '1px solid #efefef' }} alt="Activate Workday" src="https://mintcdn.com/stackone-60/4_2pV3nOIVHeWw6q/images/workday/wql/workday_wql_stackone_connector_hub_10.png?fit=max&auto=format&n=4_2pV3nOIVHeWw6q&q=85&s=1b695b9f43b675a4b040f5b039d0cf1b" width="843" height="604" data-path="images/workday/wql/workday_wql_stackone_connector_hub_10.png" />
</Frame>

<Info>
  Users will receive data based on the WQL query provided during the connection setup when they request a [list of employees](https://docs.stackone.com/hris/api-reference/employees/list-employees) using the Unified APIs.
</Info>

## Limitations of WQL

* **Calculated fields**: WQL does not support calculated fields when converting custom reports to WQL.
