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 Apps / retrieveMultiple not s...
Power Apps
Unanswered

retrieveMultiple not seeing getMetadata

(0) ShareShare
ReportReport
Posted on by 203

Hi

I have this code that is supposed to get entity metadata but it returns a 404.

 

 

 

 const metas = {},
 requests = [];

 entities.forEach(e => {
 requests.push({
 EntityFilters: 2,
 LogicalName: e,
 RetrieveAsIfPublished: false,
 getMetadata() {
 return {
 boundParameter: null,
 operationType: 1,
 operationName: "RetrieveEntityRequest",
 parameterTypes: {
 EntityFilters: {
 typeName: "Microsoft.Dynamics.CRM.EntityFilters",
 structuralProperty: 0
 },
 LogicalName: {
 typeName: "Edm.String",
 structuralProperty: 1
 },
 RetrieveAsIfPublished: {
 typeName: "Edm.Boolean",
 structuralProperty: 1
 }
 }
 };
 }
 });
 });

 console.log(`Requests: ${JSON.stringify(requests)}`);

 const result = await context.webAPI.executeMultiple(requests),
 json = result && (await result.json());

 console.log(`JSON: ${JSON.stringify(json)}`);

 

 

 

Looking at the network traffic I noticed that EntityFilters is undefined and getMetadata is null. Any help is appreciated, thanks!

 

--batch_1576117091198 Content-Type: application/http Content-Transfer-Encoding: binary GET /api/data/v9.0/RetrieveEntityRequest(EntityFilters=@EntityFilters,LogicalName=@LogicalName,RetrieveAsIfPublished=@RetrieveAsIfPublished,getMetadata=@getMetadata)?@EntityFilters=undefined&@LogicalName='account'&@RetrieveAsIfPublished=false&@getMetadata=null HTTP/1.1 Accept: application/json Prefer: odata.include-annotations="*" --batch_1576117091198 Content-Type: application/http Content-Transfer-Encoding: binary GET /api/data/v9.0/RetrieveEntityRequest(EntityFilters=@EntityFilters,LogicalName=@LogicalName,RetrieveAsIfPublished=@RetrieveAsIfPublished,getMetadata=@getMetadata)?@EntityFilters=undefined&@LogicalName='contact'&@RetrieveAsIfPublished=false&@getMetadata=null HTTP/1.1 Accept: application/json Prefer: odata.include-annotations="*"

 

 

 

I have the same question (0)
  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    Is there any reason you can't use getEntityMetadata of utility?

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-utility/getentitymetadata

  • rexkenley Profile Picture
    203 on at

    Thanks Andrew.

     

    I tried that first. The downside is that I don't need all of the entity information that it returns and it only gives a list of all attributes name with no attribute metadata information. Another drawback is that you can only do separate calls for each entity.

     

    I was hoping to get everything I need with one call in order to minimize the wait.

     

     

  • ScottDurow Profile Picture
    1,039 on at

    I have also come up against this. The only solution I could find was doing a query call using an HTTP request rather than using Xrm.WebApi.*

  • rexkenley Profile Picture
    203 on at

    @ScottDurow 

     

    Is there a getClientUrl in powerapps if I am going for the solution that you suggested? Thanks!

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    @rexkenley 

    You can use following:

    const baseUrl = (<any>context).page.getClientUrl();
  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @rexkenley ,

     

    Have you checked on the above replies? Did you solve your issue?

     

    Regards,

    Mona

  • rexkenley Profile Picture
    203 on at

    Hi Mona

     

    It didn't resolve the core issue, I am going to report this as a bug.

     

    Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard