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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Liquid code for gettin...
Power Pages
Answered

Liquid code for getting record from a filtered list

(0) ShareShare
ReportReport
Posted on by 8

Hi all, I am trying to find or make some Liquid code for fetching a record from a filtered list. I have 2 related tables with countries (parent) and cities (child), and 2 web pages with a list (countries on one page and cities on the second page). The page with the cities (child) is then filtered by the selected parent record on the countries page (some javascript code filtering child list based on ID of parent record).

At the top of the cities page I am trying to add some dynamic text using Liquid (and fetchxml?), saying something like "This list shows all cities in <name of the selected parent record>".

Or would jQuery or JavaScript or anything else be a better solution?

Would highly appreciate any good tip or code snippet that I can use 🙂

Categories:
I have the same question (0)
  • Hugo Bernier Profile Picture
    Microsoft Employee on at

    Hi @KBe ,

     

    If I understand the question right, it looks like the best solution would be to use client-side filtering using the techniques shown in this documentation.

     

    As far as writing FetchXML, I personally use XRM Toolbox to help me write my queries. 

     

    I hope this helps?!

  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @KBe ,

    if i am not wrong this is an oob feature. On the form you created in the dataverse you could say, this lookup shows only values which are related to the other lookup. When both lookups are on the form, the filtering should be done automatically.

     

    May be you give it a try.

    Have fun,

      Christian

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

    Your solution here should be based on the following components:

    • List (pointing to the county table)
    • Basic Form (pointing to the country table, containing the name of the country and a subgrid to cities)

    You shouldn't have any JS filter on the cities page

    Via Liquid or JS you can manipulate how you display the Country name field

     

    is this how your solution is looking like?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 55

#2
DP_Prabh Profile Picture

DP_Prabh 38

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 30 Most Valuable Professional

Last 30 days Overall leaderboard