More efficient way to edit items at indices in every sublist?

I needed to covert my values at index 1 and 2 in every sublist from feet to inches, while keeping the same structure. This is what I came up with:

I’m rather new to coding, and I feel like there’s a more efficient solution I’m not seeing. I tried doing some googling but wasn’t having too much luck.

Anyone care to chime in?

This is actually fairly well organized, so likely notmuch to gain by reinventing the wheel (unless you go pure code). However, List.Deconstruct only works here as you are magically not working with the first set of data but all others. If you need to work with all but the 2nd item in each list you’d be a bit stuck.

So I re-wrote your values in a slightly different order. These 5 nodes do the job fairly neatly, and can be configured to work with other indices too. It does involve some extra math with the division, but that n complexity problem will process quite quickly so it’s unlikely to be a roadblock for you.

1 Like

Randomly occurred to me that I never responded to this.

Thank you for the input! It’s very much appreciated.

1 Like

As I understand it, you want to convert the value if the parameter name is not “Length”.

Using a condition, it would be as simple as this :

That’s a great point, thank you!
I can’t believe I didn’t think of that.