How to easily truncate board's data?

Hi everyone !
I use Monday’s boards to store some aggregated data from our CRM to take advantage of the different and powerful tools provided here.
For one of my boards, I would like to use it as a container, keeping all its structure in terms of columns and automations but… I want to clear its data every day to replace its content by some new and fresh data.
Today, in order to do so, I didn’t find anything else than using the “delete_item()” function applied line by line, which… works in instance but it’s long, sometimes network saturation avoids a full clear and honestly, I expected a proper API method to “truncate” all the items of my board, at once.
So, this is my question : Is there a good way to easily truncate/empty a board without deleting it given that I want to keep my columns and automations ?
Thanks in advance.
Pierre.

Hello @pczeryba,

Are you looking to use the API or an app to achieve this. If you want to use the API, you can use the duplicate board and specify only the duplicate_board_with_structure argument. You can find that here. If you are looking to use an app, you can use the Duplicates and Uniques app and create a template which will delete your items in your board and set it to run everyday through an integration. Additionally, for your use case, you might want to check out the merge functionality of the Duplicates and Uniques app. It may be great for this particular use case. Hope this helps.

@pczeryba

Using the API, the approach that I would take would be to use the delete_group(). You just need to make sure to create the new group before you delete the old one. Every board must always have at least one group.

Jim - Subscribe to The Monday Man
Watch Our Latest Video: Get Rid of Subitems

Hi Kolaai !
Thanks for your reply.
I don’t want to duplicate because it would imply that the board would have a different ID every single day… and I’ll need it to stay in time to do others operations on that board or use some of its columns in others boards as views.

Hi @JCorrell !
Thanks for your suggestion !
Deleting groups sounds very interesting…
So, it would delete all the items of a group at once, without touching the board’s structure.
I’ll just have to keep in mind to always keep at least one so, I’ll delete a group to remove its items and then I’ll re-create the “same” Group, empty, right after.
I’l try that, thanks !

One thing to remember if you delete a group with the API. Although the groups and its items are not visible anymore the API still returns the “deleted” items when you do a query.

1 Like

@pczeryba

Groups have IDs. They can all have the same name. The sequence that I would recommend would be:

  1. get board’s group(s).
  2. create new group.
  3. delete previously collected group(s).

Easy-Peasy.

1 Like

@basdebruin

Are you saying that the items in the deleted groups still show as active from the API?

… just tested it. boards(){items()} does not return the deleted items for me.

hi @jim that’s new to me. A few month ago it indeed returned the items (I believe as inactive) but is that has changed you are all fine by deleting the groups.

@basdebruin

Did a little more testing… I thought that we used to be able to request deleted/archived items. But I was not able to get it to work… except when specifying the deleted items by ID. And then when read they returned with a state = “active”. Weird.

Hello @pczeryba!

What @JCorrell suggests about deleting the groups, and also the order of the steps he suggested looks like a great way of doing this!

Thank you @JCorrell :muscle: !

1 Like

Hi Guys !
Thanks for all your answers.
I’ve tested your suggestion so now I start by getting the existing groups from my board and parse them to create on the fly new groups with the same “title”.
It works well and deletes all the existing items, that’s cool !
But what about automations used on those groups ? I have a message saying that the existing automations are now desactivated (but in fact they are deleted) since the group they were attached to has been deleted… which sounds normal and logical you’ll say… but is there way to “keep” my automations to use them with my brand new created groups ?
By the way, I didn’t see anything about automations in the API…
Thanks in advance.

Pierre.

Oooh… I’m re-creating my automations since they have been deleted by deleting their group and now in the Automation window, I see my new but also my deleted groups…???
The only way I found to distinguish them is to change the Group color using different colors… but the deleted groups shouldn’t be visible anymore, unless it’s related to the 30 days data conservation…

Before :

After :

Hello @pczeryba!

Regarding your last comment, I have shared this with our R&D team so they can take a look. If you want, we can continue this via email if you send us one at appsupport@monday.com mentioning this community post as a reference.

Looking forward to hearing from you!

Cheers,
-Matias

1 Like

Hi Matias !
Ok, I’ll describe that in an email for the support.
Have a great day !
Pierre.

1 Like

Hello @pczeryba!

Our team looked into this and you should not see this issue any longer :muscle:

Cheers,
-Matias