Serial number in sub-lists

Hey Guys, im trying to get a little help here :slight_smile:

I want to add a serial number, to the end of all these strings.

I want it to start over for each sublist. Anyone have an idea for this? :slight_smile:

Try using list levels on your String.Insert node. Also i would recommend using an List.Count node instead of a code block as index.

Hey Daan, thx for the reply, can you elaborate this?

Hey i think i misunderstood you the first time but i am trying to create a working script at the moment.
Could you maybe share your Dyn, and possible, corresponding files on the forum?

Is this what you are looking for @Phh

Hey Daan, no its not. That is the result i already have…

Sublist 1: dddd.1
dddd.2
dddd.3

Sublist 2: dddd.1
dddd.2
dddd.3

Something like this :slight_smile:

Two options, one with OOTB nodes and the other DesignScript. The advantage of the DesignScript is that the serial gets added to the end of the string (rather than at a specific index). The OOTB node version could use String.Length to work out the index at which to place the serial.

1 Like

Thomas, can you tell my why, i dont have the level control on my List.Count?

@Phh what version of Dynamo are you running?

The levels will only appear if you check the Use Levels radio box, accessed through the forward arrow:
image

Its up to date… I figured it out :slight_smile: Thx so much