Feedback Appreciated: Splitting Lists and Using Levels

I am creating a BIM from design done by others. I have a large pipe network of an existing water line, which I have split up based on plan annotation of the proposed action to be done to that pipe (i.e. abandon it, remove it, leave it). I use property sets to assign the action, and those PSs do travel with the object thru Data Shortcuts, but for me at least, they don’t update.

As the project moves along, the removed pipes will no longer exist, but the others will. Also the contractor is proposing to abandon more pipes to reduce impact to residents. When doing a visual, I want to be able to manage the styles and visibility, so renaming the pipes is a good option, that travels thru Data Shortcuts.

I wrote this script that works, that reads the action and renames the pipes. I felt I was using Levels too much, and wasn’t sure if there was another way to filter/split the pipes. Also, I’d love to not hard code in the action and need a separate flow for each action. Do you have any feedback or tips on making this one better.

I think you just need GroupByKey. This would group everything by the action value and let you number by each sublist. The only time you need to worry about list levels is when your data starts to get unruly with the number list levels within a singular structure.