Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Answered

Fetch XML using ID from Entity List

Like (0) ShareShare
ReportReport
Posted on 20 Mar 2021 18:30:01 by 28

Hello,

 

I am selecting a record from and entity list to view in a form on another page. 

 

I'd like to use the record ID that is seen in the URL to fetch the record so that I can get the ID of a related record and then fetch that. 

 

Is the ID stored as a variable on the page?

 

Thanks

  • Trud Profile Picture
    28 on 22 Mar 2021 at 09:22:12
    Re: Fetch XML using ID from Entity List

    Thank you,

     

    Table A has Notes attached. Table B is has records related to Table A and is displayed on the entity list. 

     

    I'll select the Table B record and display details from Table B in the Form and details from Table A in a subgrid. I need to fetch the ID of Table A to Fetch the Notes associated to the Table A record to display them in a gallery. 

     

    Sorry for the confusion, hopefully that makes sense. 

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 22 Mar 2021 at 09:15:00
    Re: Fetch XML using ID from Entity List

    Hi, yeah your logic should work then, I see no issues in general.

    Just a bit confused about the relationships there

     

    You have an Entity List for Table A, then, do you have the notes associated with that record, or first you have another list/subgrid for Table B and then the link to notes? 

     

    If the former, just apply your code (probably in a Web Template) and display the pictures. 

    If the latter, you might have to first drill down into the Table B record/web page, and then get the pictures.

  • Trud Profile Picture
    28 on 21 Mar 2021 at 15:25:07
    Re: Fetch XML using ID from Entity List

    Thank you very much Oliver.

     

    I'm new to portals, thanks for your help!

     

    I have an entity list that has 'view details' against each record. This opens a Form on a different page that show the details of the selected record. 

     

    The record show in the form is related to another table record that has notes attached. The notes are pictures. 

     

    My plan was to Fetch the selected record ID to obtain the related record ID. Then Fetch the note IDs related to that ID (the related record). 

     

    I was then going to display these in a gallery using Portal URL/_entity/annotation/Note ID as the URLs like in Ritika Agarwal's video 'Working with Data in Power Apps Portals at 39:00 mins: www.youtube.com/watch?v=Ka3yfy3k3ew&t=325s

     

    The end state is a form with a gallery below showing associated pictures. I don't know if this will work, hopefully it does. Any advice would be most welcome.

  • Verified answer
    oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 21 Mar 2021 at 12:18:47
    Re: Fetch XML using ID from Entity List

    Hi, if you are opening a Web Page with Entity Form you have plenty of options to get the main record id:

    • via URL (JavaScript): 
    var recordId = new URLSearchParams(window.location.search).get("id")
    •  via Entity Form record Id hidden attribute in page (JavaScript):
    var recordId = $("#EntityFormControl_EntityFormView_EntityID").val()
    • via URL (Liquid):
    {{ request.params.id }}

     

    I am not sure what you are trying to achieve, but if you have the parent record and want to show a list of related records, all you need is to add a sub-grid in your form, you don't need any code for that.

    If you want to fetch details of a lookup related record, you can add a Quick View Form in your main Form, again no need for code.

     

    Can you explain a bit more what you need?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 2

#3
surya narayanan Profile Picture

surya narayanan 35