Using PowerShell to create an item in Monday.com?

Good morning! Currently, we are using PowerShell to send emails containing spreadsheets generated from our SQL scripts. We would like to stop sending it via email and instead send them to a board in Monday.com. Is this possible using the API?

Now, I know there is the email to item function. But, we operate out of an Outlook public folder and do not have the rights to forward email out of that folder. The best solution would be to take email completely out of the workflow and have the PowerShell script send it directly to a board in Monday.com. From my searching there doesn’t seem to be very much documentation for PowerShell & Monday.com.

How could I go about my next step?

Hello @Pearce and welcome to the community!

I hope you like it here :muscle:

What do you mean send emails? In which format do you want to send them and where do you want them to be in the board?

Thank you, I appreciate that!

We have a batch file that has PowerShell code in it. When that batch file runs, it takes the spreadsheet file in that folder, generates an email, attaches the spreadsheet to that email, then it sends the email.

I’m wanting to take out the email part and send it straight to a Monday board instead. Take the xlsx spreadsheet file in the host folder and create an item on a Monday board with that item attached along with a description

Hi Pearce, documentation of uploading files via the API is a bit scattered, but I was able to get get it to work a while back. Here are some links that should help you out.

A couple tips… When uploading files, you should use an alternate endpoint: https://api.monday.com/v2/file
Also remember that will need to create a multipart request. There are some tips in the links I posted for this.

Here is an example of a curl request:

curl --location --request POST 'https://api.monday.com/v2/file' \
--header 'Authorization: yourSuperSecretApiKey' \
--form 'query="mutation add_file($file: File!, $update_id: Int!) {add_file_to_update(update_id: $update_id, file: $file) {id}}"' \
--form 'variables="{\"update_id\":920768626}"' \
--form 'map="{\"image\":\"variables.file\"}"' \
--form 'image=@"path to your file/in local memory/cool picture.jpg'