I am trying to create a new column on an existing board and then add values to that column from a python list called hydrant_totals
. I am able to create the new column but am unsure how to dump the 51 values contained within hydrant_totals
into the new column. Note that the existing board contains the correct number of rows. Any guidance would be appreciated, I am new to GraphQL syntax. Thank you!
hydrant_totals = sorted([[k, v["TOTAL"]] for k, v in hydrant_stats.items()])
col_name = date.today().strftime("%m/%d/%y")
query = """
mutation ($colname: String!) {
create_column (board_id: 172407875, title:$colname, column_type:numbers) {
id
}
....Want to now populate this new column with hydrant_totals
}
"""
qvars = {"colname": f"COUNT {col_name}"}
api_r = requests.post(
"https://api.monday.com/v2/",
json={"query": query, "variables": qvars},
headers={"Authorization": os.getenv("MONDAY_TOKEN")},
)