cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
svenvu
Level: Powered On

Nested gallery: How to avoid delegation warning in a filter-function?

Hi

 

I have a gallery inside a gallery with Items-property of the inner subGallery set to:

Filter(
    ThisItem.SubDetails;
    Amount=0
)

SubDetails is a Common Data Service entity on the many side of the relationship

Unfortunately I get a delegation warning.

If I change the formula to "ThisItem.SubDetails" I don't get a delegation warning but then I get too many items in the subgallery. Is there any workaround to avoid the delegation warning. The official documentation says that Filter is delegable...

 

Friendly greets

 

 

 

 

 

6 REPLIES 6
Super User
Super User

Re: Nested gallery: How to avoid delegation warning in a filter-function?

Hi @svenvu 

You may want to check out the GroupBy() function to create your Gallery/Subgallery.  functions/function-groupby

@PaulD1  has a nice video about how to use it for related tables and how to use flexible height galleries to displapy the data at  Video-Gallery/PowerApps-Gallery-SubGallery-using-GroupBy-and-Flexible-Height/

svenvu
Level: Powered On

Re: Nested gallery: How to avoid delegation warning in a filter-function?

I'm watching the videos of Paul and will see if that works but I am still wondering why I get a delegation warning. Is my method wrong? Because it works without the "filter"-function. I just want to show less items, so I need to filter...

Community Support Team
Community Support Team

Re: Nested gallery: How to avoid delegation warning in a filter-function?

Hi @svenvu ,

 

Could you please share more of your data source?

Do you use one same data source or different ones?

Could you please reference this?

 

https://powerusers.microsoft.com/t5/General-Discussion/Nested-gallery-trying-to-collect-data-from-1s...

https://powerusers.microsoft.com/t5/General-Discussion/Nested-Gallery-using-same-datasource/td-p/739...

 

Hope this could be helpful.

 

Best Regards.

Yumia

svenvu
Level: Powered On

Re: Nested gallery: How to avoid delegation warning in a filter-function?

Hi @v-yuxima-msft 

 

I am using 2 custom entities in CDS as a datasource and defined a relationship between the entities:

Datasource.PNG

Datatype of:

  • ID= Autonumber field
  • MasterItemsID = Lookup field

 

Items property of the outer gallery:

MasterItems

 

Items property of the inner gallery:

I've tried the formula from the second reference but without success:

Filter(SubDetails;MasterItemsID=ThisItem.ID)

This looks like a very solid formula but the "=" is red underlined and says "Invalid argument type". Why is that if I may ask?

 

Tried some other formulas as well but without success :s

Community Support Team
Community Support Team

Re: Nested gallery: How to avoid delegation warning in a filter-function?

Hi @svenvu 

 

Could you firstly use one button to create one collection to test whether it works fine?

I test as this:

Button.OnSelect=ClearCollect(test,'2019SubDetails'.MasterItemsId)

Then the inner Gallery.Items=Filter(test,ID=ThisItem.ID)

 

Entity1.PNG

Entity2.PNG

 

Best Regards.

Yumia

svenvu
Level: Powered On

Re: Nested gallery: How to avoid delegation warning in a filter-function?

Hi @v-yuxima-msft 

 

Thank you for trying this out with me!

 

I did the same test as you did with the same formula's and didn't get any kind of errors. The subgallery ID looks fine because there are indeed always 4 subitems for each Masteritem but when I look into the collection I see it contains the columns of the MasterItems entity from CDS, and creates 4 records for each MasterItems ID.

This means that the collection does not contain the data from the SubDetails enity from CDS and therefore it seems that I can not add fields from the SubDetails to display in the inner gallery? Or do I need to add labels with other formula's?

 

So what I really need is that the outer gallery contains MasterItem fields and the inner gallery SubDetails fields

 

SubgalleryCollection.PNG

 

Friendly greets