![]() |
VOOZH | about |
Access Workday data with pure R script and standard SQL on any machine where R and Java can be installed. You can use the CData JDBC Driver for Workday and the RJDBC package to work with remote Workday data in R. By using the CData Driver, you are leveraging a driver written for industry-proven standards to access your data in the popular, open-source R language. This article shows how to use the driver to execute SQL queries to Workday and visualize Workday data by calling standard R functions.
CData provides the easiest way to access and integrate live data from Workday. Customers use CData connectivity to:
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.
You can match the driver's performance gains from multi-threading and managed code by running the multithreaded Microsoft R Open or by running open R linked with the BLAS/LAPACK libraries. This article uses Microsoft R Open 3.2.3, which is preconfigured to install packages from the Jan. 1, 2016 snapshot of the CRAN repository. This snapshot ensures reproducibility.
To use the driver, download the RJDBC package. After installing the RJDBC package, the following line loads the package:
library(RJDBC)
You will need the following information to connect to Workday as a JDBC data source:
The DBI functions, such as dbConnect and dbSendQuery, provide a unified interface for writing data access code in R. Use the following line to initialize a DBI driver that can make JDBC requests to the CData JDBC Driver for Workday:
driver <- JDBC(driverClass = "cdata.jdbc.workday.WorkdayDriver", classPath = "MyInstallationDir\lib\cdata.jdbc.workday.jar", identifier.quote = "'")
You can now use DBI functions to connect to Workday and execute SQL queries. Initialize the JDBC connection with the dbConnect function.
To connect to Workday, users need to find the Tenant and BaseURL and then select their API type.
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:
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.
| API | ConnectionType Value |
|---|---|
| WQL | WQL |
| Reports as a Service | Reports |
| REST | REST |
| SOAP | SOAP |
Your method of authentication depends on which API you are using.
See the Help documentation for more information on configuring OAuth with Workday.
For assistance in constructing the JDBC URL, use the connection string designer built into the Workday JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.workday.jar
Fill in the connection properties and copy the connection string to the clipboard.
👁 Using the built-in connection string designer to generate a JDBC URL (Salesforce is shown.)Below is a sample dbConnect call, including a typical JDBC connection string:
conn <- dbConnect(driver,"jdbc:workday:User=myuser;Password=mypassword;Tenant=mycompany_gm1;BaseURL=https://wd3-impl-services1.workday.com;ConnectionType=WQL;InitiateOAuth=GETANDREFRESH;")
The driver models Workday APIs as relational tables, views, and stored procedures. Use the following line to retrieve the list of tables:
dbListTables(conn)
You can use the dbGetQuery function to execute any SQL query supported by the Workday API:
workers <- dbGetQuery(conn,"SELECT Worker_Reference_WID, Legal_Name_Last_Name FROM Workers WHERE Legal_Name_Last_Name = 'Morgan'")
You can view the results in a data viewer window with the following command:
View(workers)
You can now analyze Workday data with any of the data visualization packages available in the CRAN repository. You can create simple bar plots with the built-in bar plot function:
par(las=2,ps=10,mar=c(5,15,4,2)) barplot(workers$Legal_Name_Last_Name, main="Workday Workers", names.arg = workers$Worker_Reference_WID, horiz=TRUE)👁 A basic bar plot. (Salesforce is shown.)
Download a free trial of the Workday Driver to get started:
Download NowLearn more:
👁 Workday IconRapidly create and deploy powerful Java applications that integrate with Workday.