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 / How to list Dataverse ...
Power Apps
Answered

How to list Dataverse m:n related items in a collection?

(0) ShareShare
ReportReport
Posted on by 21

I have a Dataverse table A, where one field is m:n related to table B. Multiple items of B can be selected for one record of A.
In a gallery of A, I can access them with Concat(ThisItem.B, B_Value) and show them together as one text line.

Is there any similar way for a collection? My target is to get a collection of A, with an added column with the values of B in one text value.
If I try something like ClearCollect(List,AddColumns(A,"B_Values",Concat(B, B_Values))) I get an error.
Any ideas?

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @OliTFD :

    I assume 'Name' is the primary key of table A,Please try:

    ClearCollect(
     List,
     AddColumns(
     A,
     "B_Values",
     Concat(
     LookUp(A,Name=ThisRecord.Name).B,
     B_Value
     )
     )
    );

    Best Regards,

    Bof

     

  • Verified answer
    OliTFD Profile Picture
    21 on at

    Dear Bof,

    thanks, but as far as I see this will not work. The two tables are m:n-related in Dataverse, with some hidden table between them. So there is no common ID to connect, and the hidden table is not directly visible in PowerApps. Even the field holding the ID related to the hidden table is not visible in Powerapps.

    Anyway, I found a solution via PowerAutomate and FetchXML in the query, so there is no more direct need for me to answer this question. But if someone knows how: Maybe it can help others.

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

    Hi @OliTFD :

    Thanks for your feedback, glad to hear you solved the problem.

    In addition, the solution I provided is based on successful test results, in general it should work

    vbofengmsft_0-1644196545138.pngvbofengmsft_1-1644196561828.png

     

    Best Regards,

    Bof

  • OliTFD Profile Picture
    21 on at

    Dear Bof,

    thanks for clearing things. I misunderstood "primary key" on the first run. As I am still interested in doing the concat right in powerapps (I found no solution to do this directly with FetchXML, so the routine in PowerAutomate became a little complicated), I tried to follow your solution with the correct tables. "A" and "B" were just placeholders.
    But I can not get it to work. Do you have any idea why? I post some screenshots of the powerapp and tables, I hope you will get the idea even if they are in german.
    "A" is called "Team_ZeitnachweisTageswerte",

    "B" is called "ESF_Tätigkeitenliste".
    The red underlinig for error starts the moment I type "Team_ZeitnachweisTageswerte" after the Lookup. 

    Bildschirmfoto 2022-02-07 um 11.00.01.jpgBildschirmfoto 2022-02-07 um 10.59.39.jpgBildschirmfoto 2022-02-07 um 10.59.25.jpgBildschirmfoto 2022-02-07 um 10.58.59.jpg

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

    Hi @OliTFD :

    I noticed there are double underscores here, and I'm guessing it's a problem with the reference to tableB. Could you try re-entering TableB's name? (It is recommended to select the automatically filled item of the prompt)

    vbofengmsft_0-1644281322931.png

    Best Regards,

    Bof

     

  • OliTFD Profile Picture
    21 on at

    Hi Bof,
    thanks for staying on this. I tried a few times only using the automatically offered items, and finally got at least the Lookup-Part to work... but now I am stuck with the last part. For the "B-Value" (primary name of B), I get only fields of table A offered, non of B. 
    I tried it at least 5 times, every time with the same result. Do you have any idea how to fix this?

    Bildschirmfoto 2022-02-08 um 09.32.12.jpg

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard