Automate Monday.com Integration Tasks from PowerShell
The CData ADO.NET Provider for Monday.com is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Monday.com.
ADO.NET Provider
The ADO.NET Provider provides a SQL interface for Monday.com; this tutorial shows how to use the Provider to retrieve Monday.com data.
Once you have acquired the necessary connection properties, accessing Monday.com data in PowerShell can be enabled in three steps.
You can connect to Monday.com using either API Token authentication or OAuth authentication.
Connecting with an API Token
Connect to Monday.com by specifying the APIToken. Set the AuthScheme to Token and obtain the APIToken as follows:
- API tokens for admin users
- Log in to your Monday.com account and click on your avatar in the bottom left corner.
- Select Admin.
- Select "API" on the left side of the Admin page.
- Click the "Copy" button to copy the user's API token.
- API tokens for non-admin users
- Click on your profile picture in the bottom left of your screen.
- Select "Developers"
- Click "Developer" and then "My Access Tokens" at the top.
- Select "Show" next to the API token, where you'll be able to copy it.
Connecting with OAuth Authentication
Alternatively, you can establish a connection using OAuth (refer to the OAuth section of the Help documentation).
-
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Monday.com\lib\System.Data.CData.Monday.dll") -
Connect to Monday.com:
$conn= New-Object System.Data.CData.Monday.MondayConnection("APIToken=eyJhbGciOiJIUzI1NiJ9.yJ0aWQiOjE0MTc4NzIxMiwidWlkIjoyNzI3ODM3OSwiaWFkIjoiMjAyMi0wMS0yMFQxMDo0NjoxMy45NDFaIiwicGV;") $conn.Open() -
Instantiate the MondayDataAdapter, execute an SQL query, and output the results:
$sql="SELECT Id, DueDate from Invoices" $da= New-Object System.Data.CData.Monday.MondayDataAdapter($sql, $conn) $dt= New-Object System.Data.DataTable $da.Fill($dt) $dt.Rows | foreach { Write-Host $_.id $_.duedate }