Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Choose entity out of list and then choose one of the field names of that entity in an canvas app

Posted on by 155

Hello,

I want to make an canvas app in Powerapps where you can from a gallery one of the (custom) entities in CRM. After that I want to choose from the field(names) of that chosen entity.

I know how to make that happen in PowerApps. The problem I'am facing is that I can't find/get the  entities or the fields going with that entity. I tried the following entities in CDS/Dataverse:

  • Entities
  • Entitylist
  • Metadata from entityform

They all show up emtpy. Which table/entity do I have to choose to get a list with all entities in my App and after that which table(s) contain the fields per entity?

Thank you in advance!! 

  • BrutusG Profile Picture
    BrutusG 155 on at
    RE: Choose entity out of list and then choose one of the field names of that entity in an canvas app

    Thank you for your explanation Daniel!

  • Suggested answer
    RE: Choose entity out of list and then choose one of the field names of that entity in an canvas app

    Hello BrutusG,

    thank you very much for reaching out to the CRM Forum. I did not exactly understand, if you are facing the issue, that no entites/tables and attributes/fields are listed to choose at your gallery datasource, of if you want to get a list of all your (custom) entites and attributes retrieved, to list it at your gallery/CanvasApp itself.

    So please let me explain, in case you cannot see the entities listed, for selecting at DataSource at your Gallery, please make sure, you created the CanvasApp at your particluar CRM/CDS environment selected, and not the default environment:

    pastedimage1611132540267v1.png

    If you want to list all the entites and attributes of your CRM environment, there is no specific Table, at which all entities are listed and I also think, there is no out-of-the-box PowerPlatform Function availalbe, to do this.

    But you can get the metadata and information about all your entites/tables and the attributes, using the WebAPI at your CRM/CDS environment. So it should be possible, you create a Flow or an Azure Function, which retrieves the WebAPI data (using http request or REST), and return the data back to your Canvas App.

    To do so, you can use the WebAPI functions for EntityDefinitions, like:

    https://<org>.crm.dynamics.com/api/data/v9.1/EntityDefinitions?$select=LogicalName,DisplayName
    https://<org>.crm.dynamics.com/api/data/v9.1/EntityDefinitions(LogicalName='account')/Attributes?$select=LogicalName

    This will return in oData v4 Format/JSON all the LogicalNames and DisplayNames of your environment, and the second request, will list all fields/attributes of the "account" entity for example.
    If you are further familiar with the WebAPI, you see, you can also add also different fields, like checking, if it's a customizable entity with the field IsCustomizable, or using the filter for IsCustomizable/Value eq true (https://<org>.crm.dynamics.com/api/data/v9.1/EntityDefinitions?$select=LogicalName,DisplayName,IsCustomizable&$filter=IsCustomizable/Value eq true)

    For more information about the WebAPI function and a possible way, to do so with Flow, please have a look at the following URLs:

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/retrieve-metadata-name-metadataid

    https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-metadata-web-api

    https://powerapps.microsoft.com/en-us/blog/return-an-array-from-flow-to-powerapps-response-method/

    I hope, this information will further help you with your issue.

    Thank you very much, please let me know, if you have any further questions on this or if this resolved your issue, have a nice day and please stay further healthy.

    Best regards

    Daniel

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,986 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans