I have a form where we are showing multiple sections which is collapsable. I made couple of sections as collapsed initially thinking that contents would not load until user expand the section. But its not the case, contents are still evaluating even if section is collapsed by default.
I need certain data to be collapsed to improve the initail loading screen and need to do validation on clicking submit even for collapsed one. Section layout is perfectly doing the validation but its loading the contents in the background.
Any suggestions or thoughts?
Discussion posts and replies are publicly visible
You're correct that collapsed sections still evaluate their contents because isInitiallyCollapsed only controls visual display, not evaluation. To achieve on-demand content loading while maintaining validation, use conditional evaluation with if() statements controlled by a local variable tracking the expansion state. When the section is collapsed, the if() returns empty content preventing evaluation. When expanded, it loads the heavy content. Place your validations in the section's validations parameter not inside the conditional content so they still execute on submit regardless of collapse state. For Appian 25.3, wrap your expensive queries in a!asyncVariable() within the conditional logic for even better performance. This loads data asynchronously and shows placeholder skeletons. The pattern would be local!sectionData: if(local!isExpanded, a!asyncVariable(rule!expensiveQuery()), null). This approach gives you the performance benefit of loading content only when needed while preserving form validation functionality.