Sort order of nested collection list

Hello,

I am struggling with the sort order of News on the website…

I’m sorting the articles based on months and each month has multi-reference of related articles… But for some reason, there is no way to sort nested collections… Is there any way around it, even with custom code? The design is approved so I don’t really want to do some stepbacks and I really don’t understand is why that function is not there at all… such no-brainer :frowning:

Read only link → Webflow - Pekárek

Thanks for any advice!


Here is my public share link: LINK
(how to access public share link)

1 Like

I struggled with the same issue! But then I realized that the order of the items in the nested collection was actually set when I added the items to the top level collection. So, when I create an article in my CMS and add multiple events to be listed on it, the order of these events is defined by the order in which I add them. Hope it makes sense.

The fact that these lists can’t be ordered automatically is very annoying. Mostly you just want to sort them by date. Right now if you have a huge multi-reference, you have to delete all the points and order them by yourself. The worst thing is, that you are not even seeing the date since the multi-reference picker only let’s you see the name.

webflow please fix this asap!

1 Like

This is an annoying shortcoming. In the absence of it working intuitively, I’ve taken the step of exporting from Webflow to CSV, editing and reordering the multi-reference field in Google Sheets using a fancy formula, then exporting from Google Sheets to CSV and importing back into Webflow. Sounds like a lot but only takes a minute or two. Here are the enumerated steps:

  1. Export Webflow collection to CSV
  2. Import into Google Sheet
  3. In a new column, enter the formula below and copy it to all rows. Before copying down, replace C3 with whatever cell the ‘documents’ field is in.
  4. Copy the values from the new column, and paste them as values only back into the ‘documents’ column
  5. Delete the new column
  6. Export from Google Sheets to CSV
  7. Upload back to the ‘products’ collection in Webflow

=concatenate(sort(transpose(split(substitute((C3&“; “),”; “,”; |”),“|”))))

Hope this helps

Yes it can be done using code.
https://webflow-collections.webflow.io/sorting

Thanks @memetican. It says it only works for up to 5 items. Any way to do more?

The sorting script doesn’t have any limit.

If you mean the nested collections themselves, that’s a hard limit in Webflow.
To overcome that, you’d need to generate your embed list in a separate collection list, and then use script to reposition them.

Let me note however, that when you hit this limit and it’s frustrating your design, you probably aren’t using them as they were intended. This might help;

If you know what you’re doing in your design and absolutely want to find a way through that, Finsweet has some tools for this, I’d start there first.