cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Trud
Frequent Visitor

Fetch XML using ID from Entity List

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

1 ACCEPTED SOLUTION

Accepted Solutions
OliverRodrigues
Super User II
Super User II

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?




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

4 REPLIES 4
OliverRodrigues
Super User II
Super User II

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?




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

Trud
Frequent Visitor

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.

OliverRodrigues
Super User II
Super User II

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.




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


 

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. 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (33,349)