cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bran
New Member

At what point is a FetchXML query actually executed with liquid?

II would like to create a liquid template that contains all of my fetchXML functions I'll use throughout the portal. I want to include this template on every page and within the page retrieve the values I need for that specific page. 

 

If I were to make a template that contains all of my fetchXML functions and include it on each page, will they all be executed each time? Or are they only executed when I use the xxx.results.entities and assign it to a variable? 

 

Having them all on one page makes it a lot more organized rather then having fetchXML spread out on all my pages. 

1 ACCEPTED SOLUTION

Accepted Solutions
OliverRodrigues
Super User
Super User

Hi @bran 

The FetchXML only retrieves the data once you invoke the xxx.results.entities 

So it shouldn't have any major performance impact having a single Web Template with lots of FetchXML, a few things to have in mind:

 

  • this would load several objects in memory, so the web app itself would be heavier
  • those would be cached as well, so the internal caching database would be larger
  • I haven't tested here how you would access the Fetch object from different pages, but I am assuming you have that figured out already
  • try to come up with a nice naming convention for those fetches, just so they don't conflict with anything else from your pages



If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

3 REPLIES 3
OliverRodrigues
Super User
Super User

Hi @bran 

The FetchXML only retrieves the data once you invoke the xxx.results.entities 

So it shouldn't have any major performance impact having a single Web Template with lots of FetchXML, a few things to have in mind:

 

  • this would load several objects in memory, so the web app itself would be heavier
  • those would be cached as well, so the internal caching database would be larger
  • I haven't tested here how you would access the Fetch object from different pages, but I am assuming you have that figured out already
  • try to come up with a nice naming convention for those fetches, just so they don't conflict with anything else from your pages



If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Perfect. I didn't consider the memory aspects of it. It will be a max of maybe 10 or so fetchXML functions on the page. I'm coming from PHP and I'm used to having on my db functions in a consolidated file that I can then pick from when needed. Thanks!

Fubar
Solution Sage
Solution Sage

Rather than putting all queries in one template, I would probably break them up into multiple templates and then "Include" the ones I wanted in Liquid e.g. if xxx then include template A else Include template B (can also do switch).

Helpful resources

Announcements
Carousel News & Announcements 768460.png

What's New in the Community?

Check out the latest News & Events in the community!

Carousel Community Blog 768x460.png

Check out the Community Blog

Read all about the most recent blogs in the community!

MPP IDEAS updated 768x460.png

Ideas

Discover ideas and concepts from users like you for how to use Power Pages and take your work to the next level.

Need Assistance in the Community.PNG

Community Support

Learn more about how to interact in the community and more.

Users online (1,510)