Notifications
Announcements
creating a web template to represent entity data in tree structure ..
to get n no.of child hierarchy need to loop in javascript fuction .. where my entity has data paret column and Child column..
how to loop entity data in javascript function.
To answer properly need to better understand what you are doing (provide some of your code etc).
Usually you run a fetch query in Liquid and then loop the results (in liquid) and write an array, Object, or JSON object as a JS variable. Then in JS you just access the variable you created.
Accessing the data in the JS variable would be a for, forEach, via Keyword, for key in, or in JQuery $.each() etc depending on how you approach it
Thank you Fubar for your response.
in my entity having data like.
i want to represent like:
to get this... i am fetching my entity data
through fetchxml in liquid code
something that I like to do is create a web template that will retrieve my data in a JSON format, you can follow the steps from this article: https://www.inogic.com/blog/2020/11/use-of-json-type-web-templates-in-powerapps-portals/
Either the way in the link Oliver provided or something similar.
The example in the link is where you setup a web template and then use ajax to call a page based on that template - if you want to just put it in the Web Template behind your page rather than calling the other page it is very similar except where they dump out the JSON (about line 16 in the image in the link) you just do a
<script> var myResult = { "results": ...output here ......} </script> then when the template renders you just access myResult.
The approach depends on what you may need - e.g. are you going to want to load the JSON from the fetchxml multiple times (or need to re-fetch with a condition based on some user input) when on the page or do you just need it there at the web page load.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Jerry-IN 71
Fubar 62 Super User 2025 Season 2
sannavajjala87 31