Python API multiple items for Drop-down field

Hello,

I’m struggeling with the API. I’m using Python (Django Framework) for my contact form. In this form is a multiple choice checkbox which I want to match to the drop-down field in monday.com.

Now I have to iterate through the list in the dictionary “data_dict”. Does anyone have an idea how to do this?

This is my vars dictionary from the API:

vars = {
    'myItemName': data_dict['nachname'] + ", " + data_dict['vorname'],
    'columnVals': json.dumps({
        'status': {'label': 'Neu'},
        'e_mail': {'email': data_dict['email'], 'text': data_dict['email']},
        'telefon': {'phone': str(data_dict['telefon']), 'countryShortName': 'CH'},
        'text9': data_dict['plz'],
        'drop_down': {'labels': [data_dict['person']]},
        'drop_down5': {'labels': [data_dict['beruf']]},
        'drop_down59': {'labels': [data_dict['prio'][0]]},
        'drop_down7': {'labels': [data_dict['alter']]},
    })
}

As it is now just the first item would be passed in to the ‘drop_down59’ field. But there should be multiple items if not empty.

Kind regards,
Klemens

Hi @klemensgraf, welcome to the community!

Our dropdown column is a bit tricky to work with from our API, but I would be happy to take a look.

At this time, are you experiencing any errors? Or is it just that your dropdown labels aren’t populating as you expect?

In any case, the first thing you need to make sure of is that the dropdown column currently has these labels that you’re trying to create. See this section of our API documentation: API v2 Documentation.

If this is indeed the case, then I would check to make sure that your drop_down59 column labels are in the correct format (so each label separated by a “,”).

If you’re looking for an easy way to populate multiple labels, I would recommend creating a list or something already populated with the labels you want and separated by “,” and then returning this in the labels section of drop_down59.

-Helen

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