How to display both Object key and value using collactions
How to display both Object key and value using collactions
At a glance
The community member has an object they want to display in a list, where the object key would be the title and the value would be some text. They tried using a collection, but encountered issues where the previous items' values were undefined. The community members discussed that collections only accept arrays, not objects, and that the data would need to be changed on the backend before working with it in the webstudio. They also suggested describing the use case with sample data to better understand the need to iterate over an object. The community members eventually concluded that a collection is not necessary for the given use case, and that an array would be the way to go, especially if the number of items is not large.
i have a an object and i would to display this object in a list, the object key would be title and value would be a text under it. i tried using collection but when i set the value for value for one i am getting undefine for the previous items
i am doing something like this to get the key ${collectionItem.key}
Probably also better describe your use case with a sample of the data and explaining why you need to iterate over object, I have a strong feeling there is a mistake in wanting to do that
Don't need to iterate unless this collection is dynamic, means items are getting added and removed dynamically and there is a lot of them, you have on the screenshot 4 items