Ensure uniqueness of items

For the project I am working on, I want to move a table of about 600 items (item data and amount of items can change) from an Umbraco database over to Monday.com, in which I am using C# and GraphQL, this process can be called multiple times and is a way to synchronize Institutions data to a group on a Monday.com board. I want every item to be unique by the Item name (there can only be one ‘Institutions 1’ and one ‘Institutions 2’). To achieve this I first create the columns with ‘create_column’ to match that of the institution Model (Country, YearEstablished, StaffCount etc…). Then I get all the items that exist currently using ‘items_by_multiple_column_values’ and check if there is an item with that ‘Item Name’, if there is an item I update the items data with ‘change_multiple_column_values’, if the item is not there I create the item with ‘create_item’. I am using C# async awaitable functions to ensure I get a result back before proceeding to the next API call.

My problem is with ‘items_by_multiple_column_values’ – it sometimes returns an empty array or missing items that I have previously created resulting with duplicated items in my group on the board. Seems to be some kind of caching issue on the Monday.com’s side, I am observing that if I wait a long time between each time I synchronize from the database to Monday.com I don’t end up with duplicated items. Is there a more reliable way of getting all items?

Is there any way to ensure uniqueness for these items, like a “Create Or Update Item”? Other than having to get all items in the group and then add or update depending on if there currently is an item in the table already? I don’t want the client that initiate the sync to have to wait between each time and having a unreliable system where they might end up with duplicate items.

  • Andreas :blush:

Hello @AndreasNordboe and welcome to the community!

I hope you like it here :muscle:

When using items_by_multiple_column_values it can take about 32 seconds (maybe a bit more if there is a lot of traffic in the server) from the moment a change is made to an item until the moment it is retrievable using this method. You could implement a timeout that considers other mutations (if you update via API only) or maybe query for all the names of all the items and check on your end about the possible duplicates.