I've been unable to find a way to create a truly empty List variable in a Script.
Despite what's mentioned in Refresh List in script , if you create an "empty" list Variable, the list still has an empty string in the first place, which creates a blank space when you start pushing values into the List.
Scenario:
I have 2 lists, one being filled by a Data Action with values (ticket ids) , the other is one that displays customised labels for the corresponding values. So the first (lets call it idList) is the values list for a dropdown while the second (statesList) is the Label list for the dropdown.
Any time a search is executed I assign the Array of values to idList through the Data Action, but (since data actions lack tools for iteratively process a variable number of string inputs in a list), I have a series of dynamic variables that generate the desired labels and push them one by one into the "emptied statesList" (by previously assigning it the "EmptyList", except I can't find a "simple" way of creating a truly empty list. it always have an empty string in the first place, as you can see in the screenshot:
This in itself would be just a graphical glitch and perfectly bearable... however, this misaligns the value-label lists, so in the screenshot the ID 643007 has the value below it, 642960. (You can also note that the last Label is not displayed because the value list has only five elements while the label list has six)
I am able to create an empty List by using a "dummy" data action the outputs an Empty array, but I would prefer to not be calling Data Actions without needing to (I'm calling /api/v2/date and always outputting an empty array)
You can see in this example that the list has no empty item in the first place.
I have also tried the "Set Variable" and not configure the second value (thinking it would give a not_set or null value), but this of course creates an error.
(For this specific issue I would accept a way to creating a truly dummy data action that doesn't call any webservice endpoint, since the Data Action workaround works... but the question remains of how can you start from scratch on a List in order to start pushing values into it.