Forum Discussion
Working with Arrays of Ranges
The ideas proposed in this discussion appear to be working well. The data dictionary allows arrays of ranges to be stored (as would the multi-area range) but the ranges may be mixed with calculated arrays. It is possible to return a data dictionary from a LAMBDA function as a single array object.
A specific use examined in Dynamic Let Function | Microsoft Community Hub allows the contents of multiple LET variables to be returned and scrolled through as and aid to debugging.
The format introduced in this discussion allows an in-memory data dictionary to be written to a worksheet to persist the data beyond the LAMBDA/LET environment in which it was created. Functions are provided to enable any other Lambda function to reload the dictionary from the worksheet if needed.
Since the data dictionary contains only references to data in memory and not the actual data arrays it should be possible to replicate it or pass it to other functions with relatively low overhead (this is speculation not, as yet, backed by evidence). Due to immutability, it is not possible to append a data item to a dictionary, but multiple dictionaries may be stacked to form a new, more comprehensive, dictionary.
The image shows the result of simply returning a dictionary (here formed from a set of LET variables); the result of creating a persistent copy using a function;
= DB.PERSISTĪ»(TESTĪ»(a,b))
and a single item selected from the re-read dictionary by a spinner setting (this final object is included merely to demonstrate that the data has been re-read from the worksheet).