Hi, I need help I’m sending an http request from Power Apps, so every time a new email comes in on outlook I send the email data to monday.com including the email attachments if there’s any.
There are a couple of things that I think might be at play here:
It is not possible to create an item AND upload a file in a single mutation call. You’d have to use create_item first, and then the file upload mutations (add_file_to_update,add_file_to_column);
You will also need to send the file’s byte-stream when uploading the file to monday.com. As such, you will most likely need to upload the file from local storage, so I don’t think Power Automate will do the trick here.
I recommend taking a look at our API docs for Files, as it has some examples of how this works in JavaScript, and how you could set this up.
I hope this helps, although I understand it isn’t quite the answer you were looking forwardd to.
Perhaps the mon-cli client for Python might be helpful, in that case? It already has most of the API functions you’d need to implement something similar.
In terms of uploading files, you’ll need to use binary data, so perhaps base64 could work too.
Firstly, thank you @AlexSavchuk so much for the endorsement! We are truly thankful for the support, for we have put a great deal of time into this SDK so that you don’t have to.
As far as uploading files from base64, Moncli does not support that natively. However if you are able to write the file locally to disc, you can use that file path to upload the file after the item has been created. Here is an example below of how the file upload can be done:
from moncli import client
client.api_key = 'insert_api_key'
board_name = 'insert_board_name'
file_column_title = 'insert_file_column_title' # You can use ID, but it is easier this way.
file_path = 'insert_full_file_path'
board = client.get_board(name=board_name)
# This will return your newly created item with all of your column values in one request.
item = board.add_item('item_name', get_column_values=True)
file_value = item.column_values[file_column_title]
asset = item.add_file(file_value, file_path)
I would be happy to work with you @mxolisi further should you need any assistance.