Data upload from external database using python

I want to be able to query data directly from my database so that once a form is entered on my website its posted to my database and the latest lead information is then dumped to our CRM board in Monday.com. I cant seem to find a solution to help with this anywhere. I’ve read through the Python API tutorial but everything seems more geared towards pulling data from Monday as opposed to pushing data to Monday.

Any help with this would be great.

Hey @HughAlex :wave:

I’d love to shed more light on this! Also, my warmest welcome to a namesake :nerd_face: I hope you enjoy your stay.

When using the API with Python to add data to monday.com boards, you would need to create items with values populated. I recommend checking out the following section in our Python Quickstart:

Creating an item with values populated

You can also find some example code in this Python library:

monday.com Python Library

-Alex

1 Like

@HughAlex
I have only been playing around with the API for a bit, but in addition to the answer from @AlexSavchuk , I have found it beneficial to use the playground to fiddle around with queries:

https://monday.com/developers/v2/try-it-yourself

This way, you can interact with your board – get board IDs and post data to specific boards before starting to code.

1 Like

@christoffer

Thanks so much for your input here! I can also recommend taking a look at your account’s Developers section, as you can find the API playground there as well, linked directly to your account. Sometimes this can be move convenient, as you wouldn’t need to copy-paste your API key. Here’s how to get there:

Once you’re in the Developers section, you can then find the API playground in the top bar:

-Alex

1 Like

@AlexSavchuk

Always great to speak with a namesake as well. I tried incorporating the python library and follow the quick instructions and my traceback was asking for the api url which I have but the library doesnt mention it in its quick code. Any ideas on how to include it? It also doesnt mention how to input values into columns it just says column_values =none. Any idea how to add in specific columns? I tried column_id = “data”, but that didnt work as well.

@AlexSavchuk Any update to my follow up questions from 4 days ago?

@HughAlex

Sorry, seems like this one fell through the cracks on my end. My apologies for the delay!

Please make sure to always use “https://api.monday.com/v2” as your API URL! As far as column values go, this depends on the column type you are trying to update, and there are different ways to update the same column, as some columns include both JSON and String value formatting. Do you have specific code in place that you’d like to use to create a new item on monday.com, or to update an existing item’s column values? I’d love to take a closer look and see how we can implement this together.

-Alex

Hey @AlexSavchuk no worries. I was able to get it to post which is progress now trying to figure out how to add value to the columns. Can I just use the “text” field in the JSON or does it rely on the “value” field to actually POST the value to the column? I am trying to create a new item.

1 Like

@HughAlex

Thank you for circling back with me!

Some columns support string values, while others will only expect JSON values. You can find more info on both value types you can use in the documentation below:

Change Column Values with Strings
Change Column Value with JSON

The create_item mutation will accept a mix of values, as long as the column you are trying to update the value of can support both value types. Does that make sense?

-Alex

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.