I have an app for inbound receipt of parcels where the user story requires the display of the list of values scan to build from the bottom, such that the first value in the list is the most recent one scanned.
This list is then used to log data into tables, and further along in the process, to print labels.
The users would like the label print order to correspond to the scan order. Since during scanning I’m inserting the new value at index 0, as opposed to popping it onto the array, my log order which drives my label print order (by datetime logged) is the reverse.
It occurs to me I can just populate two variables with the data, one for display (insert at index 0) and the other for logging (pop onto), but curious if there is a more elegant way to leverage the same array but in reverse order.
Suggestions?
*push onto array
apologies for my improper terminology
How come we can’t edit posts anymore? That used to be a thing…
You should be able to do the same thing with an object. Have one piece of it as the data inheritance. Then the next field as an integer to represent your index and increment at each addition.
Then push that into an object array and use the interactive table widget to display your array and sort it with the interactive table.
This has the obvious advantage of using tulips in interactive table tool and everything that comes with it. And also looks cleaner for the end user.
Downside would be object handling on tulips side is quite poor in my opinion. So it can be hard to manage at time. But since you have the index readily available some of the array functions to deal with a specific object in your new array are a bit better with this method.