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 / Showing Records from d...
Power Apps
Unanswered

Showing Records from different entities

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi People,
I have a requirement in my app that in a single tab we need a table of all records from different entities.
Is it possible?

Categories:
I have the same question (0)
  • pontusofsweden Profile Picture
    255 on at

    Hi @Anonymous !

     

    Can you be a little more specific. What are you trying to accomplish? How are the entities related to each other? 

    BR

    Pontus

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @pontusofswedenWe have 3 entities in which I have different records and those 3 are not related to each other but at a single screen I need to show the list of all records and along with those records an added column in which it will display the entity name.

  • pontusofsweden Profile Picture
    255 on at

    Ok! Do you have the same column names (ish) in all the entities? One approach is to create a collection where you merge all the records from each entity and add a column for the Entity name. Then you can use the new collection as a single datasource in a gallery. Here is a sample formula to merge the records:

     

    ForAll(TableA;Collect(NewTable;AddColumns(TableA;"Entity";"TableA")));;ForAll(TableB;Collect(NewTable;AddColumns(TableB;"Entity";"TableB")));;ForAll(TableC;Collect(NewTable;AddColumns(TableC;"Entity";"TableC")))

     

    If you have different column names, you can add conditions for the labels in the gallery. Like:

     

    If(!IsBlank(ThisItem.Name);ThisItem.Name;If(!IsBlank(ThisItem.Names);ThisItem.Names;If(!IsBlank(ThisItem.Namn);ThisItem.Namn)))

    BR

    Pontus

     

     

     

     

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @pontusofswedenThanks for your reply!
    No, I don't have any columns with same name in all 3 entities And also what are you referring to when you said "Table A".?
    I just need a list of records.

  • pontusofsweden Profile Picture
    255 on at

    Hi!

     

    TableA is in your case EntityA (since I dont know the name of your entities). The problem is that you can only use one datasource in a gallery, for instance. My suggestion, according to the formula provided, is to merge EntityA, EntityB and EntityC into a new Collection (NewTable) that you can use as a datasource in the gallery. With this formula, all records in the list will have a reference to the Entity which you can show on the screen.

     

    BR

    Pontus

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @pontusofswedenWe did manage to create a collection the trouble that we are having is that we are not able to add a column that specifies the name of the entity that record is from.
    Can you help me with that?

    Happy Holidays

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you mean that you have 3 entities that have no relationship, you want to save them to the same collection and add a column record its entity names?

    If so,I've made a similar test for your reference:

    Since these three entities have different column names, I'm afraid you need to firstly create a table will all fields'name that these three entities have. Or else, you can not save them together.

    Try this formula:

    ClearCollect(newentity,{field1:"",field2:"",field3:"",.....,entityname:""});
    Collect(newentity,AddColumns(entity1,"entityname","entity1"),
     AddColumns(entity2,"entityname","entity2"),
     AddColumns(entity3,"entityname","entity3")
     )

    Please note that you need to pay attention to the data type in step1. "" represent text type. If the field is not text type, then you could not update successfully in step2.

    If it is a choice type, you need to use fieldname:{Value:""}  at step1.

    If it is datetime type, you need to use DateTimeValue("") at step1.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-yutliu-msftThank you so much.
    Should I write this code on OnVisible Property of the page where I want to show the data ?
    Sorry im a beginner in powerapps.

  • pontusofsweden Profile Picture
    255 on at

    Hi!

     

    Yeah, you need to trigger the merge somehow. Maybe on OnSelect of the button that gets you to your screen? OnVisible is also an option of course, I rarely use it myself but it´s doable.

     

    BR

    Pontus

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 481

#2
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#3
11manish Profile Picture

11manish 291

Last 30 days Overall leaderboard