The week column presents the relative week(s) (from the current week) of the dates inputted.

Check out our help center to learn more about the week column.

Reading the week column

You can return the data in a week column in two different formats. The text field will return the data as a simple string, and the value field will return the data as a JSON string.

Here is an example payload showing both fields:

{
  "text": "2022-07-18 - 2022-07-24",
  "value": "{\"week\":{\"endDate\":\"2022-07-24\",\"startDate\":\"2022-07-18\"}}"
}

Updating the week column

You can update a week column with a JSON string. Simple string updates are not supported.

JSON

To update a week column send the start and end dates in a YYYY-MM-DD format. The dates must be 7 days apart (inclusive of the first and last date) and start at the beginning of the work week defined in the account settings.

For example: "{\"week\":{\"startDate\":\"2019-06-10\",\"endDate\":\"2019-06-16\"}}"

Code example

mutation {
  change_multiple_column_values(item_id:11111, board_id:22222, column_values: "{\"week0\" : {\"startDate\" : \"2019-06-10\", \"endDate\" : \"2019-06-16\"}}") {
    id
  }
}
fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    query : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id }}",
    variables : JSON.stringify({
      myBoardId: YOUR_BOARD_ID,
      myItemId: YOUR_ITEM_ID,
      myColumnValues: "{\"week0\" : {\"startDate\" : \"2019-06-10\", \"endDate\" : \"2019-06-16\"}}"
    })
  })
})
curl "https://api.monday.com/v2" \
-X POST \
-H "Content-Type:application/json" \
-H "Authorization:MY_API_KEY" \
-d '{"query":"mutation{change_multiple_column_values(item_id:162169283, board_id:162169280, column_values:\"{\\\"week0\\\" : {\\\"startDate\\\" : \\\"2019-06-10\\\", \\\"endDate\\\" : \\\"2019-06-16\\\"}}\"){name}}"}'

๐Ÿ“˜

Do you have questions?

Join our developer community! You can share your questions and learn from fellow users and monday.com product experts.

Donโ€™t forget to search before opening a new topic!


Did this page help you?