Connect to Workday Data from Blazor Apps



Build ASP.NET Core Blazor C# apps that integrate with real-time Workday data using standard SQL.

Blazor is a framework for developing modern, client-side web UIs using .NET technology. Instead of coding in JavaScript, developers can use the familiar C# language and .NET libraries to build app UIs.

The CData ADO.NET Provider for Workday can be used with standard ADO.NET interfaces, such as LINQ and Entity Framework, to interact with live Workday data. Since Blazor supports .NET Core, developers can use CData ADO.NET Providers in Blazor apps. In this article, we will guide you to build a simple Blazor app that talks to Workday using standard SQL queries.

About Workday Data Integration

CData provides the easiest way to access and integrate live data from Workday. Customers use CData connectivity to:

  • Access the tables and datasets you create in Prism Analytics Data Catalog, working with the native Workday data hub without compromising the fidelity of your Workday system.
  • Access Workday Reports-as-a-Service to surface data from departmental datasets not available from Prism and datasets larger than Prism allows.
  • Access base data objects with WQL, REST, or SOAP, getting more granular, detailed access but with the potential need for Workday admins or IT to help craft queries.

Users frequently integrate Workday with analytics tools such as Tableau, Power BI, and Excel, and leverage our tools to replicate Workday data to databases or data warehouses. Access is secured at the user level, based on the authenticated user's identity and role.

For more information on configuring Workday to work with CData, refer to our Knowledge Base articles: Comprehensive Workday Connectivity through Workday WQL and Reports-as-a-Service & Workday + CData: Connection & Integration Best Practices.


Getting Started


Install the CData ADO.NET Provider for Workday

CData ADO.NET Providers allow users to access Workday just like they would access SQL Server, using simple SQL queries.

Install the Workday ADO.NET Data Provider from the CData website or from NuGet. Search NuGet for "Workday ADO.NET Data Provider."

Create a Workday-Connected Blazor App

Start by creating a Blazor project that references the CData ADO.NET Provider for Workday

  1. Create a Blazor project on Visual Studio.
  2. From the Solution Explorer, right click Dependencies, then click Add Project Reference.
  3. In the Reference Manager, click the Browse button, and choose the .dll file of the installed ADO.NET Provider (e.g. System.Data.CData.Workday.dll, typically located at C:\Program Files\CData\CData ADO.NET Provider for Workday\lib etstandard2.0).

SELECT Workday Data from the Blazor App

  1. Open the Index.razor file from the Project page.
  2. In a WorkdayConnection object, set the connection string:

    To connect to Workday, users need to find the Tenant and BaseURL and then select their API type.

    Obtaining the BaseURL and Tenant

    To obtain the BaseURL and Tenant properties, log into Workday and search for "View API Clients." On this screen, you'll find the Workday REST API Endpoint, a URL that includes both the BaseURL and Tenant.

    The format of the REST API Endpoint is: https://domain.com/subdirectories/mycompany, where:

    • https://domain.com/subdirectories/ is the BaseURL.
    • mycompany (the portion of the url after the very last slash) is the Tenant.
    For example, in the REST API endpoint https://wd3-impl-services1.workday.com/ccx/api/v1/mycompany, the BaseURL is https://wd3-impl-services1.workday.com and the Tenant is mycompany.

    Using ConnectionType to Select the API

    The value you use for the ConnectionType property determines which Workday API you use. See our Community Article for more information on Workday connectivity options and best practices.

    APIConnectionType Value
    WQLWQL
    Reports as a ServiceReports
    RESTREST
    SOAPSOAP

    Authentication

    Your method of authentication depends on which API you are using.

    • WQL, Reports as a Service, REST: Use OAuth authentication.
    • SOAP: Use Basic or OAuth authentication.

    See the Help documentation for more information on configuring OAuth with Workday.

    For example: User=myuser;Password=mypassword;Tenant=mycompany_gm1;BaseURL=https://wd3-impl-services1.workday.com;ConnectionType=WQL;

  3. The code below creates a simple Blazor app for displaying Workday data, using standard SQL to query Workday just like SQL Server.

          @page "/"
          @using System.Data;
          @using System.Data.CData.Workday;
          
          <h1>Hello, world!</h1>
          
          Welcome to your Data app.
          
          <div class="row">
              <div class="col-12">
          
                  @using (WorkdayConnection connection = new WorkdayConnection(
                    "User=myuser;Password=mypassword;Tenant=mycompany_gm1;BaseURL=https://wd3-impl-services1.workday.com;ConnectionType=WQL;"))
                  {
                      var sql = "SELECT Worker_Reference_WID, Legal_Name_Last_Name FROM Workers WHERE Legal_Name_Last_Name = 'Morgan'";
                      var results = new DataTable();
          
                      WorkdayDataAdapter dataAdapter = new WorkdayDataAdapter(sql, connection);
                      dataAdapter.Fill(results);
          
                      <table class="table table-bordered">
                          <thead class="thead-light">
                              <tr>
                                  @foreach (DataColumn item in results.Rows[0].Table.Columns)
                                  {
                                      <th scope="col">@item.ColumnName</th>
                                  }
                              </tr>
                          </thead>
                          <tbody>
                              @foreach (DataRow row in results.Rows)
                              {
                                  <tr>
                                      @foreach (var column in row.ItemArray)
                                      {
                                          <td>@column.ToString()</td>
                                      }
                                  </tr>
                              }
                          </tbody>
                      </table>
                  }
              </div>
          </div>
        
  4. Rebuild and run the project. The ADO.NET Provider renders Workday data as an HTML table in the Blazor app.

    At this point, you have a Workday-connected Blazor app, capable of working with live Workday data just like you would work with a SQL Server instance. Download a free, 30-day trial and start working with live Workday data in your Blazor apps today.

Ready to get started?

Download a free trial of the Workday Data Provider to get started:

 Download Now

Learn more:

Workday Icon Workday ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Workday.