Filter and flatten nested list of lists preserving indices

I have a nested list of lists which shows rooms and which floors are inside them. However I can’t seem to work out how to convert that list so that it only shows floors whilst preserving the indices (images below should explain more):

This demonstrates the intended purpose/workflow thereafter:

Hi erfajo, cheers for the input. As you highlighted the index method fails when trying to preserve null fields:

2 Likes

Yes, I reckon this should get me there provided I can use the ‘empty’ entries in the original list as a Boolean mask on the list of all rooms. That way the indices for my rooms and floors will match up. Cheers

Left the office now, will have to try it out later.