Create empty list with n amount of rows

Hi,

I want to generate/create a list based on a given amount of numbers (integer of number). However I just seem unable to do so.

The result that I want is:
List
[0] empty
[1] empty
etc.

This has to be generated by a number.

Thanks in advance

List.OfRepeatedItems with an empty list as the item I put and the number you want as the other import.

1 Like

Thanks for your fast reply, however this does not solve my problem.

I want an empty list that exists of 2 rows. Not an empty list that consist of two empty lists. What should be the item for this?

Each empty list is a row, not an empty list.

If you are looking for a different data type, you need to pass that data type. However Dynamo doesn’t have such a thing as an empty. Perhaps a null is what you are after?

3 Likes

Hello,
if that’s what you’re looking for


it’s a lot of emptiness :wink:
cordially
christian.stan

2 Likes

Aahhh I supose a null is what I’m after.
How do you create that?

Type it in a code block. :slight_smile:

Note that null is a bad data type for downstream automation with Dynamo - it will cause errors in most nodes… what are you really after with the larger automation?

ahhh thank you!

Well I want to create an excel sheet, however the first column is 2 cells longer then the other column, so the second column needs to pushed 2 cells down in order to make both columns even long.

Null is the right data type then. Or an empty string. Both work in this context, but I would do so as the very last step.

List.InsertItemAtIndex would be how I would do this. Might need two in a row, or a List.Flatten with levels set correctly.

1 Like