The fill task fills the elements of an array with a static value. You can specify where to start and stop filling. If not specified, all elements are filled. This task overwrites (modifies) the original array.
Use this task when you have a dataset and want to populate it with some unique values. For example, if you have a counter whose values need to be incremented over time, you could use the fill task to populate the counter with the new values.
In this example:
arr variable is set to ["1","2","3","4"].value variable is contained in the New Variable:Test reference task, located in another workflow. The value provided is [a,b,c].start and end were not provided, so defaults are used.filledArray output is [a,b,c],[a,b,c],[a,b,c],[a,b,c] — each element of the incoming array is replaced with the value from the reference task.
In this example:
arr variable is set to ["1","2","3","4"].value variable is static with a value of 42.start and end were not provided, so defaults are used.filledArray output is [42,42,42,42] — the entire array is filled with 42, replacing all initial values.
In this example:
arr variable is statically set to ["Toyota","Mazda","Datsun"].value used to fill the array is statically set to ["Nissan"].start and end are statically set to 2, so filling begins at position 2 of the array.filledArray output is ["Toyota","Mazda","Nissan"] — Datsun at position 2 is replaced by Nissan.