KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Listbox Access Differences Between Objects and Scalar Values
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: June 24, 2024

When creating a collection or entity selection listbox, it can be important to pay attention to what type the elements inside the listbox are. Often they are objects, but scalar values can also be inserted.

The property list may be used to set different data source variables. If the Current item property variable is always found to be null, it’s likely because the listbox contains scalar values. In this instance, the cells may still be accessed using the Selected Items source. Example: selectedCells[0].

In this screenshot the listbox is populated using FOLDER LIST and DOCUMENT LIST, which output String arrays, turned into a collection using ARRAY TO COLLECTION. Current item is set to the variable selectedDocument.



Here it is shown that the value of selectedDocument is null, yet the other data sources contain values that may be utilized.