cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
shahriat
Helper I
Helper I

How to use FetchXML in Portal to retrieve parent and child entities records together?

I have three entity list created in portal and I use Odata to retrieve their records as a result my app getting slow.

 

My current request structure:

 

for(... parentEntity) 

    for(... childParentEntity)

         for(...childEntity)

 

but in CRM we easily resolve this issue in a single request using FetchXML.

 

How to use FetchXML to resolve above issue in portal like CRM we do using advanced query?

 

Please suggest your valuable advice. 

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
OliverRodrigues
Super User II
Super User II

Hi, you can use FetchXML in the Portals as well: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/template-tags

I must confess I stopped using entity list oData and I much prefer using the following approach, which is creating your own Retrieve API via Fetch/Web Templates: https://powerobjects.com/development/creating-a-custom-portal-api-retrieve-data/

 




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

5 REPLIES 5
OliverRodrigues
Super User II
Super User II

Hi, you can use FetchXML in the Portals as well: https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/template-tags

I must confess I stopped using entity list oData and I much prefer using the following approach, which is creating your own Retrieve API via Fetch/Web Templates: https://powerobjects.com/development/creating-a-custom-portal-api-retrieve-data/

 




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

Hi @OliverRodrigues,

 

Thank you for your quick response.

 

I have seen your given url earlier but my concern is how to make those 3 nested relational request into a single fetchxml query or any liquid syntax?

Hi you can use fetchxml inside the web template to query data.

Depends on exactly what you need to do, sometimes you may put everything in one query (if FetchXML supports it) returning one dataset that you then loop through the result, or you make multiple fetchxml calls one after the other substituting in the relevant id's etc into the subsequent queries.

 

You can see a simple FetchXML example in the Step 3. 14 of the following:https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations#example showing the fetch and how to loop it (ignore the other stuff as it relates to the Web Api).

 

 

OliverRodrigues
Super User II
Super User II

"but in CRM we easily resolve this issue in a single request using FetchXML."

 

When you said the above, I assumed you can get the fetch via CRM, so basically you can copy and paste the fetch.. otherwise you might have to loop through the results and perform additional fetches




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


 

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Users online (57,973)