Can I replace the empty value with the connected value?

You can replace an empty value with your section.
But i don’t know how your fittings and pipes are connected. So i can’t place the right value in it.
For my example i placed “test” into the empty slots.

When you have a list with boolean values you can use the BoolMask node to filter a list by your boolean values.

Maybe this helps…

There are ways to check which fitting is connected to a pipe: