web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Pages
Unanswered

FetchXML through JS

(0) ShareShare
ReportReport
Posted on by 117

Hello, I have some data that I need from some specific dataverse tables.

Problem is I need to query a table to get some data and use that data to query other tables.

Is there any way to do that? If I normally use FetchXML, all of them run an the same time, I can not use the result of one in another, or at least I don't know how.

I thought maybe something with JS, if possible.

 

Thank you.

Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @sweb ,

    in case of that kind of requirements, i create a liquid template which uses fetchxml to make the queries. Either you make several "services" out of that or you create a bigger template with several fetches. Never tried but i think, you can use results of a fetch in the next fetch.

    https://learn.microsoft.com/en-us/power-pages/configure/liquid/template-tags#fetchxml

     

    For the parameter you can just use request.params.<whateveryouparameteris>

    https://learn.microsoft.com/en-us/power-pages/configure/liquid/liquid-objects#request

     

    When creating that kind of things, just create a liquid (=web) template, assign it to a pagetemplate and IMPORTANT: swicth off "render header and footer" and then create a page with that pagetemplate. The liquid will be renderered as it is and you can create for example a jsonoutput. 

    Hope this points in the right direction,

      Christian

     

  • sweb Profile Picture
    117 on at

    Hi @chleverenz , I don't know if I explained correctly.

    I have multiple queries, all of them get executed at the same time, so I don't have any results to start with.

    My first query returns some data, I need some of that data to execute the second query.

    Have read both your links, I don't seem to understand the solution.

    Can I have more details?

     

    Now the site is slow, one query has 7000+ results. I save the data to a JS variable and use the data from the other queries to filter out the one with 7000+ and get the data I need. As I said, site is so slow, takes 1-2 mins to load, sometimes even crashes.

  • Verified answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Why not using the Portals API?

    On the click/select of each record you run the additional queries.

    Does that make sense?

     

  • sweb Profile Picture
    117 on at

    Thanks @OliverRodrigues, had no idea about the API, it's exactly what I need, I thought the only way to get data is through FetchXML.

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard