Hi everyone,
I’m encountering an issue in OutSystems Developer Cloud (ODC) when using nested lists inside a Local Variable to display hierarchical data.
Data model:
I have three entities:
Product: Id, Name
ProductCategory: Id, Name, ProductId
ProductCategoryFeature: Id, Name, ProductCategoryId
Each product can have multiple categories, and each category can have multiple features.
Process:
When I select a product in my overview screen, I load all related categories and, for each category, all related features. I build this structure inside a Local Variable (List) that is bound to my UI. Each list item represents one category and contains a nested list of features.
This works fine at first. However, after saving and reloading the data several times, the following issue occurs:
The categories are loaded and displayed correctly.
The features are no longer displayed in the UI, even though they are still present in the Local Variable (verified in the debugger).
So the data is in memory, but the UI does not render the nested lists anymore.
Save process:
When saving, I write everything back to the database in this order:
Save the product
Save the categories
Save the features (linked to the category IDs)
After saving, I reload all data into the same Local Variable by looping through the categories and adding their related features.
Observed behavior:
The first few load–save–reload cycles work as expected.
After several iterations, the UI stops displaying the nested feature lists.
The features are still visible in the Local Variable during debugging.
Refreshing or reloading the screen does not make them visible again.
It looks as if the nested list binding between the Local Variable and the UI becomes stale or invalid after multiple updates.
Has anyone experienced this behavior with nested lists in Local Variables in ODC? It seems that after multiple save and reload cycles, the nested bindings are lost, even though the data itself is still present.
What is the recommended approach for handling hierarchical data (e.g., Category → Feature lists) in ODC so that the nested data continues to render correctly?
Hello @Benjamin Sala,
Let’s go through this step by step.
The nested list you’re using is most likely coming from a backend source either an Aggregate or a Data Action. After each successful CRUD operation (in your case, creating a new Product along with its Categories and Features), you should be refreshing that source, correct?
If I were in your position, I wouldn’t manually loop through the backend data to assign it into a local variable. Instead, I’d create an Aggregate that combines the three entities, selecting only the attributes you actually need. You can then structure the result in a DTO-style structure that mirrors your hierarchy (Product → Category → Feature).
From there, use the On After Fetch event of that Aggregate (or Data Action) to assign its output directly to the local variable with the same structure. This keeps the data consistent, ensures the UI stays synchronized with the backend, and avoids issues caused by rebuilding nested lists in memory.
If you still prefer to handle the logic manually, I’d recommend first checking the Traces in the ODC Portal for any errors or timeouts that might have occurred during the save process.
Alternatively, you could force an unload and reload of the data after saving. In practice, this means adding an Assign node after the save logic (e.g., after the Save button action) to clear the local variable, and then rebuilding it from scratch in a loop. This guarantees you’re repopulating the list from a clean state and helps prevent stale data references from causing rendering issues.
If it helps, let me know or of course, if you want, you can share the .oml so I can help you further.