How to use Format node with lists as data input

I find the Format node useful and use if often , but when using lists as data it behaves not how it expecting it to behave., being append formatted data to the list, but it doesn’t. It replaces at same index.


The alternative using multiple Format nodes and Merge seem messy when one has multiple data inputs. Someone knows of a more elegant alternative ?

format.gh (19.6 KB)

Hi @crz_06 ,
the format node take always the longest list and not the list length from the F input for the output T which is really confusing and i see no usecase where this behaviour is uselful and it makes no sense to me.

Anyway you could use the replace node.


text replace.gh (12.8 KB)

just chiming in. I feel like the format component is best use for a single line of statement if you wanted an output like debugging.

in your case I feel like the best approach is just use an expression, it is more understandable and you have an option to combine it or not;

or if you’re comfortable, the best way to do this trivial tasks is just to write lines of code.
format_.gh (14.2 KB)

2 Likes


Notice I changed ref_{1} to ref_{0}.
You can flatten T output.

2 Likes

thanks for all these sugegstions. Seems i was not alone hoping for a more streamlines component :wink: