Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Charles Hewitt
153
Views
2
Comments
Populating Nested Structures from a Query
Discussion
Data
How-to
Is it possible to populate a structure that contains another structure nested within it from an Advanced Query or even a Simple Query, peferably without using an Action?
For example to return the structure Orders that contains the structure Line Items.
At the moment the query is demanding an array to populate the nested structure.
Are there any examples available?
Thanks
Charles
Nuno Roxo
Hello Charles,
First of all, sorry by the late response.
Unfortunatelly is not possible to use nested structures in the output structures of the queries, so you'll need to develop some logic based on 'for each'.
You can check two examples
here
, and you can check the logic on the attached module.
Version 1 it is better than version 2, because you're doing only one query instead of doing one query inside the 'for each', that is not recomendable (in you case, if you have a huge number of orders, and each order has a huge number of line items, you can have performance issues).
Please, if you have more questions don't hesitate, we are here to help you!
Thank you!
Best Regards,
Nuno Roxo
NestedStructures.oml
Vera Tiago
Staff
Hi
I had the same issue a few weeks ago... and the solution was similar.
1st - Query
2nd - Foreach to iterate and
populate the nested structure
cheers,
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...