cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Poweruser1101
Helper II
Helper II

Group Data shown in Gallery based on related table field

Hi All,

 

I have an embedded canvas app on my Model Driven Form.I have subgrid on my Form in dataverse and the subgrid table has a lookup of another table and I want to display data of the subgrid in a gallery control and apply grouping to it.

 

Poweruser1101_0-1638869679053.png

Poweruser1101_0-1638870886750.png

 

 

Poweruser1101_2-1638870407992.png

 

As shown in the image, 'Risk Grade Assessment' is the main table on which I have a subgrid of 'Risk Grade Assessment Question' table.'Risk Grade Assessment Question' has a look up of 'Risk Grade Question' and 'Risk Grade Question' table has a lookup of 'Category'.

 

I want to group my gallery based on Category and want to count the questions against it but since the category is not available in 'Risk Grade Assessment Question' table I am unable to do grouping

 

Data to be displayed in the gallery

 

CategoryCount of Questions
Asset Characteristics3
Market Condition1

 

I tried creating a collection like the below and I want to add the Category Column in the collection so that I can use it for grouping in the gallery

 

ClearCollect(RGAssessmentQuestions, ShowColumns(Filter('Risk Grade Assessment Questions', ThisRecord.'Risk Grade Assessment'.'CS Risk Grade Assessment'=[@ModelDrivenFormIntegration].Item.'CS Risk Grade Assessment'),"ice_RiskGradeQuestion","ice_question","ice_response"));

 

Also tried without collection directly setting the items property of the gallery as follows but not sure how to get Category here and also apply grouping -

Filter('Risk Grade Assessment Questions', ThisRecord.'Risk Grade Assessment'.'CS Risk Grade Assessment'=[@ModelDrivenFormIntegration].Item.'CS Risk Grade Assessment')

 

And i can display category using the below formula in the label in the gallery

LookUp('Risk Grade Questions',ThisRecord.'Risk Grade Question'=GUID(ThisItem.ice_RiskGradeQuestion.'Risk Grade Question')).Category.Category

 

Kindly suggest.

 

0 REPLIES 0

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (6,194)