Webflow: deleting collection items from a secondary locale (EN)

Hello everyone.

I am trying to delete collection items from a secondary locale (EN) but everything I have tried is only deleting the primary locale items. I am wondering is it doable with the standard modules? I also tried a API call and a HTTP request. And tried to filter, but I am a bit lost here.

If I use the “get site module” i do get the Cms Local Ids, but the get collection and get collection items modules are only configurable with the main (primary collection) right?

What would be a set-up that works for this? I now have this set-up and experimented a bit with modules (the top part works and deletes primary items)

I managed to get all the items the secondary locale with an api call, does any one know a json that can delete these? much like the delete item module?(webflow)

Thanks in advance.

Solved :slight_smile: After looking at it for a day.

2 Likes

Hello @PatrickP welcome to the community and congrats on getting this up and running! :muscle:

Would you maybe mind sharing a brief summary of what did the final trick for you for the benefit of the community?

Thanks a lot :raised_hands:

1 Like

@Michaela Yes sure.

Some explanation first. This scenario is the way i need it, deleting all items from both the primary and secondary Webflow locales. I imagine this approach will also work for updating / patching items (maybe I need that in the future).

I also want to thank the make.com support team which helped me on the way in some aspects.

How does Webflow appear to handle locales (at least as far I can see)
How the Webflow locale collections seem to be set-up by Webflow. In designer and the editor I guess, there is a relation with items created in the primary locale, they are also created in the secondary (and probably all your other locales) That relation is not here if you use their API.
At first I thought it was a afterthought, but it makes perfect sense, because even in Designer and Editor, you can make a collection item for a specific locale and it wont end-up in the primary locale.

So using the standard Webflow Delete Item module won’t help you, as it will only delete the primary locale collection items.

How does webflow keep track?? They keep track of the locales by adding a extra ID for the locale: cmsLocaleId the rest is kept the same, so the collection id and the item id, in the case of the item id, it wont always be unique and the seem to use the same ids across all locales (probably when you only create items from the primary locale in Designer and editor)

This does complicate things when trying to retrieve the locales with the standard Webflow modules in make.com, as the are not able to resolve these locales (they only look at the (primary)collection id).

But how will I get this working?
So if you want to loop through your locale items, you need to use the Make a api call (Webflow) or make a http request module.

//Keep in mind you need your header for authorization and a bearer key for this//

Run a GET on the url that has the collection-id and locale-id as parameter in it.

https://api.webflow.com/v2/collections/your collection id/items?cmsLocaleId=your locale id

It will return an array with items, after this module run iterate on body items, this will return everything in bundles ready for processing. (and yes item ids can have the same id as the primary id, they will be processed, when they are there in the array, double check)

The last step is I guess, use another Api call module or a http request module and loop through all the items, deleting them. I my case a DELETE with this url: (endpoint) (as specified by Webflow API documentation)

https://api.webflow.com/v2/collections/your collection id/items/your item id from the iterator?cmsLocaleId=your locale id

Does this make sense? Does anyone have other insights.

PS: I would suggest that make.com to update all their Webflow modules that handle Webflow collections and items, to incorporate selecting the locale ids and handeling them in a easy way. Not everyone is tech savvy in the low-code / no-code community. And multi-language is such a big priority for Webflow and us the users.

PS: my end scenario looks about the same as the above image, with only the iterator and the http request module added in the bottom part, so api call → iterator → http request

2 Likes