Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Automate Monday.com Integration Tasks from PowerShell
Are you in search of a quick and easy way to access Monday.com data from PowerShell? This article demonstrates how to utilize the Monday.com Cmdlets for tasks like connecting to Monday.com data, automating operations, downloading data, and more.
The CData Cmdlets for Monday.com are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Monday.com.
PowerShell Cmdlets or ADO.NET Provider?
The Cmdlets are not only a PowerShell interface to Monday.com, but also an SQL interface; this tutorial shows how to use both to retrieve Monday.com data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Monday.com. To access Monday.com data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Monday.com.
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).
PowerShell
-
Install the module:
Install-Module MondayCmdlets
-
Connect:
$monday = Connect-Monday -APIToken "$APIToken"
-
Search for and retrieve data:
$status = "SENT" $invoices = Select-Monday -Connection $monday -Table "Invoices" -Where "Status = `'$Status`'" $invoices
You can also use the Invoke-Monday cmdlet to execute SQL commands:
$invoices = Invoke-Monday -Connection $monday -Query 'SELECT * FROM Invoices WHERE Status = @Status' -Params @{'@Status'='SENT'}
ADO.NET
-
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 }