Hour column doesnt store values

Hey,
I have created a integration that fills inn information from another document. Everything works as it should, but when i refresh the site all the values in the hour columns disappear.
They show the right value before i refresh. And all the other columns that gets updated keeps their values, its only the hour column that disappears.

When the integration runs (before refresh).

After refresh:

Hey @SindreSvee

I’d love to take a further look at this behavior with you! Just to make sure we’re on the same page here, is there any chance you could provide a screenshot of your Integromat setup? This would help us understand what might be causing those results for you.

Once we have those details, we’d be able to take a closer look and see how to best resolve this together :slight_smile:

Thank you so much for your patience and cooperation!

-Alex

Hey hey @AlexSavchuk !

Thank you so much for your reply, I am using the monday-sdk in nodeJs to fetch an array from an external XML file.
Then it checks if the ID from the array exist in an number column on the board, if it does update column values, if it doesnt exist create new item.

Everything here works as it should exept that the values from the hour columns both disappears when i refresh the page. When i log the output from the changeColumnValue it sends it as it should.

I have simplefied some of the code here, but i have validated that the issue still occurs.

monday-controller.js:

const mondayService = require('../services/monday-service');
const xmlService = require('../services/xmlRead-service');

async function addDataToBoard(req, res) {
  const { shortLivedToken } = req.session;
  const { payload } = req.body;

  try {
const { inputFields } = payload;
const { boardId, groupId, xmlLink, dataIDColumnId, targetTime, targetNumber} = inputFields;

//Get data data
const fetchData = await xmlService.queryXMLData(xmlLink);

fetchData.forEach(async getData =>{ // Run for all IDs
  const listAllColumnWithID = await mondayService.getItemByColumnValue(shortLivedToken, boardId, dataIDColumnId, ""+parseInt(getData.$.id)+"", 1);

  if(listAllColumnWithID.toString()){ //If ID Exist on board, update values.
    let mondayItemIdToUpdate = listAllColumnWithID.map(({ id }) => id).toString(); // Item ids from monday that have

    //Update column values.
    await mondayService.changeColumnValue(shortLivedToken, boardId, parseInt(mondayItemIdToUpdate), targetTime, JSON.stringify({"hour": parseInt(getData.Time_of_event).toString().substring(0,2),"minute": parseInt(getData.Time_of_event).toString().substring(2,4)}));
    await mondayService.changeColumnValue(shortLivedToken, boardId, parseInt(mondayItemIdToUpdate), targetNumber, "\""+parseInt(getData.Number_of_available_seats)+"\"");

  } else { // If ID doesnt exist on board, create new item.
    //removed to simplify.

  };

});

return res.status(200).send({});
  } catch (err) {
console.error(err);
return res.status(500).send({ message: 'internal server error' });
  }
}

mondayService.changeColumnValue:

const changeColumnValue = async (token, boardId, itemId, columnId, value) => {
  try {
    const mondayClient = initMondayClient({ token });
    const query = `mutation change_column_value($boardId: Int!, $itemId: Int!, $columnId: String!, $value: JSON!) {
            change_column_value(board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) {
              id
            }
          }
          `;
        const variables = { boardId, columnId, itemId, value };

        const response = await mondayClient.api(query, { variables });
        return response;
      } catch (err) {
        console.error(err);
      }
    };

mondayService.getItemByColumnValue:

const getItemByColumnValue = async (token,  boardId, columnId, columnValue, limit) => {
  try {
    const mondayClient = initMondayClient();
    mondayClient.setToken(token);

    const query = `query($boardId: Int!, $columnId: String!, $columnValue: String!, $limit: Int!) {
        items_by_column_values(board_id: $boardId, column_id: $columnId, column_value: $columnValue, limit: $limit) {
          id
        }
      }`;

    const variables = { boardId, columnId, columnValue, limit };
    const response = await mondayClient.api(query, { variables });
    return response.data.items_by_column_values;

  } catch (err) {
    console.error(err);
  }
};

I have sendt you a message with a link to a quick video how it looks on the board.

Thanks.
-Sindre

Not sure if this is related, but we have some recurring meetings in a Monday calendar board. I have automations set to copy the item and push the date by 1 week and I notice that the Hour columns don’t always copy correctly or are blank.

Hey,
To follow up on this,
When i change the column to a text or number column it works as it should.

Here is the same values on a hour column and one on a number column.
Before refresh:

After refresh:

Hey @andrewalmand,

Thanks for chiming in! I would suggest writing to our support inbox directly, as it sounds like a potential issue with the automation setup, perhaps. You can reach us at support@monday.com - this would be your best point of contact for this specific case!

@SindreSvee

Thank you for following up on this and adding further detail to how your code is structured! I would love to take a further look at the exact column values you are attempting to send here. I’ve just tested updating the column values of a Hour column via the API, using both the GraphQL playground, as well as Postman, and wasn’t able to reproduce this. The format for my Hour column values is as follows:

"{\"hour\":16,\"minute\":42}"

Would you be able to provide the exact values you are currently sending? I’d love to take a closer look at a specific example here.

-Alex

1 Like