Create array with numbers

Which workflow node would be easiest to use if I just wanted to create an array of incremental integer numbers and add to the payload? i.e number 100 to 150

Hey @Lars_Andersson,

There are a few ways to achieve this, but I’d love to get a sense of your use case so I can point you in the right direction. What are you looking to do with this array? Are you looking to do this on every workflow run? Will the beginning and ending numbers change?

Any additional information you can provide would be very beneficial!

Thank you,
Heath

Sorry, I often leave out some details…
I have a device I’m reading some test record data from with an edge agent.
But I only know the starting number and ending number of the test record.
To loop over each record number I need an aray like [0]=100,[1]=101,[2]=102…[49]=150.
Is a function node my only option?

@Lars_Andersson,

The Loop Node can take a number as the Loop Source. This would also give you the current index, so you could then use a Math Node to adjust a value to the value you need it to be.

Let me know if this works for this use case.

Heath