cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SaWu
Level 8

Many-to-many relationship table not working for Items/Collect, CountRows ok though

Hello

Please be so kind as to read my full post before responding.
Thank you for your consideration.

In one of my PowerApps, I want to show a Gallery of items of a custom "WelcomeApp Event Config" entity, which is linked to the default systemuser entity via a many-to-many relationship "kk_kk_welcomeapp_userconfig_systemuser", depending on the user who is logged in.
image.png
I have a two other many-to-many relationships between custom entitities which don't cause any problems.
Since this is a pretty recent PowerApp, the relational data feature is turned on by default.
image.png
But with this particular relationship, I don't seem to be able to use the relational table as Items or for Collect.
Both of them only yield an empty (?) table.
CountRows works though.

What happens in my App is that with App.OnStart I have:

Set(userEmail, User().Email);
Set(testCount, CountRows(LookUp([@Benutzer], 'Primäre E-Mail-Adresse'=userEmail).'WelcomeApp Event Configs (kk_kk_welcomeapp_userconfig_systemuser)'));
ClearCollect(testCollect, LookUp([@Benutzer], 'Primäre E-Mail-Adresse'=userEmail).'WelcomeApp Event Configs (kk_kk_welcomeapp_userconfig_systemuser)');

CountRows gives the correct result from the CRM, but Collect of the counted thing yields nothing
image.pngimage.pngimage.png
I've also tried directly using the relational table as Items of a gallery EventConfigsGallery.Items

LookUp([@Benutzer], 'Primäre E-Mail-Adresse'=userEmail).'WelcomeApp Event Configs (kk_kk_welcomeapp_userconfig_systemuser)'

image.png
and set Text of a Label to

CountRows(testCollect) & "/" & testCount & ", " &
CountRows(EventConfigsGallery.AllItems) & "/" &
CountRows(LookUp([@Benutzer], 'Primäre E-Mail-Adresse'=userEmail).'WelcomeApp Event Configs (kk_kk_welcomeapp_userconfig_systemuser)') &
" Events"

yieldingimage.png

This only showcases the same problem I had with App.OnStart.

My questions

  1. How do I get this to work?
  2. What's the problem here?
  3. Am I using the wrong entry from the (below) autocomplete list?
  4. Is there something special about (many-to-many?) relationships to the systemuser entity because there's already a lot of standard relationships to that entity anyway?
    image.pngimage.pngimage.png

 

Thank you,
     Sa.

2 REPLIES 2
Community Support Team
Community Support Team

Re: Many-to-many relationship table not working for Items/Collect, CountRows ok though

Hi @SaWu ,

Could you tell me what is "kk_kk_welcomeapp_userconfig_systemuser" ? a look up field?

Usually, only in one-to-many relationship, it will generate automatically a lookup field in the "many" entity.

So, I need more details about your issue.

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
SaWu
Level 8

Re: Many-to-many relationship table not working for Items/Collect, CountRows ok though

Hi @v-yutliu-msft 

Please be so kind as to actually read my post.
My post mentions several times, with screenshots, what that name is for.
It is not a lookup field.

And you are wrong about the new relational Data tables.
They are always appear as a new "fake" field in the one entity for one-to-many relationships.
The many entity only carries the lookup field but no relational data field.

Relational data tables/fields are supposed to work for many to many relationships as well.
In this case the "new" fake field with relational Data appears in both entities.
https://powerapps.microsoft.com/en-us/blog/option-sets-and-many-to-many-relationships-for-canvas-app...
image.png

Thank you,
   Sa Wu.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,773)