This might be easier than you think, you can use a global “array” (actually a Map object) to store values keyed by Item name. Usage shown here