{"id":1801,"date":"2021-11-28T13:27:41","date_gmt":"2021-11-28T13:27:41","guid":{"rendered":"https:\/\/365stack.in\/?p=1801"},"modified":"2021-11-29T12:07:05","modified_gmt":"2021-11-29T12:07:05","slug":"how-to-create-nested-gallery-in-power-apps","status":"publish","type":"post","link":"https:\/\/365stack.in\/index.php\/2021\/11\/28\/how-to-create-nested-gallery-in-power-apps\/","title":{"rendered":"How to create Nested Gallery in Power Apps"},"content":{"rendered":"\n<p>Let&#8217;s try to build a PowerApps&#8217;s Nested gallery view using <em>GroupBy <\/em>function to achieve the Grouping functionality of SharePoint List<\/p>\n\n\n\n<p>We have used below sample data in Collection as a data source for the galleries used in this Nested Gallery Application and we can also use any data source to feed the data to gallery.  <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ClearCollect(\n    collCountry,\n    {\n        country: \"India\",\n        city: \"Chennai\",\n        address: \"Address 1\",\n        pincode: \"89889\"\n    },\n    {\n        country: \"USA\",\n        city: \"NY\",\n        address: \"Address 1\",\n        pincode: \"012\"\n    }\n)<\/code><\/pre>\n\n\n\n<p>Create the above collection with additional data in the &#8220;OnStart&#8217; property of the app and Use &#8216;GroupBy&#8217; function to Group the collection by Country colum.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Syntax\n\nGroupBy( source, columnName, GroupColumnName)<\/code><\/pre>\n\n\n\n<p>Source is where the function will be applied,  columnName is the column to group the records and GroupColumnName is the name of the column where grouped records kept.   Grouped Records would not carry the column used to group the data.<\/p>\n\n\n\n<p>Store the result of the GroupBy function in another collection &#8216;ColGroupedCountry&#8217;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Actual expression\nClearCollect(\n    colGroupedCountry,\n    GroupBy(\n        collCountry,\n        \"country\",\n        \"DATA\"\n    )\n);<\/code><\/pre>\n\n\n\n<p>The GroupBy function returns a table with records grouped together based on the values in one or more columns. Records in the same group are placed into a single record, with a column added that holds a nested table of the remaining columns.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1812\" data-permalink=\"https:\/\/365stack.in\/index.php\/2021\/11\/28\/how-to-create-nested-gallery-in-power-apps\/screenshot-2021-11-28-112351\/\" data-orig-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-112351.png?fit=217%2C410&amp;ssl=1?v=1638078876\" data-orig-size=\"217,410\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2021-11-28-112351\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-112351.png?fit=159%2C300&amp;ssl=1?v=1638078876\" data-large-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-112351.png?fit=217%2C410&amp;ssl=1?v=1638078876\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-112351.png?resize=107%2C202&#038;ssl=1\" alt=\"\" class=\"wp-image-1812\" width=\"107\" height=\"202\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-112351.png?w=217&amp;ssl=1 217w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-112351.png?w=159&amp;ssl=1 159w\" sizes=\"auto, (max-width: 107px) 100vw, 107px\" data-recalc-dims=\"1\" \/><figcaption>Result of the GroupBy<\/figcaption><\/figure><\/div>\n\n\n\n<p>Add a new Gallery &#8216;ParentGallery&#8217; to the screen and set &#8216;colGroupedcountry&#8217; collection as Items property of the gallery.  Add a new label to this ParentGallery and set the Text property of the label with below expression<\/p>\n\n\n<p>Items = ThisItem.Country<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"263\" data-attachment-id=\"1816\" data-permalink=\"https:\/\/365stack.in\/index.php\/2021\/11\/28\/how-to-create-nested-gallery-in-power-apps\/screenshot-2021-11-28-183218\/\" data-orig-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?fit=1512%2C622&amp;ssl=1?v=1638104568\" data-orig-size=\"1512,622\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2021-11-28-183218\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?fit=300%2C123&amp;ssl=1?v=1638104568\" data-large-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?fit=640%2C263&amp;ssl=1?v=1638104568\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218-1024x421.png?resize=640%2C263&#038;ssl=1\" alt=\"\" class=\"wp-image-1816\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?w=1512&amp;ssl=1 1512w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183218.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>As a next step, add a new gallery &#8216;ChildGallery&#8217; inside the &#8220;ParentGallery&#8217; and set &#8216;ThisItem.DATA&#8217; as Items property of the Child gallery.  Add labels to the child gallery and map them with &#8216;Address&#8217;, &#8216;City&#8217; and &#8216;Pincode&#8217;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"254\" data-attachment-id=\"1818\" data-permalink=\"https:\/\/365stack.in\/index.php\/2021\/11\/28\/how-to-create-nested-gallery-in-power-apps\/screenshot-2021-11-28-183835\/\" data-orig-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183835-e1638106039601.png?fit=872%2C424&amp;ssl=1?v=1638104932\" data-orig-size=\"872,424\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-2021-11-28-183835\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183835-e1638106039601.png?fit=300%2C146&amp;ssl=1?v=1638104932\" data-large-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183835-e1638106039601.png?fit=640%2C254&amp;ssl=1?v=1638104932\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183835-1024x407.png?resize=640%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-1818\" data-recalc-dims=\"1\"\/><\/figure>\n\n\n\n<p>Set below expression as Text property to show the number of records under each group.<\/p>\n\n\n<p>Text = ThisItem.country &amp; &#8220;(&#8221; &amp; CountRows(ChildGallery.AllItems) &amp; &#8220;)&#8221;<\/p>\n\n\n\n<p>Use following expression to set the Height property of Child gallery dynamically based on number of grouped records.<\/p>\n\n\n<p>Height = If(ThisItem.IsSelected, If(CountRows(ChildGallery.AllItems) &gt; 0, CountRows(ChildGallery.AllItems)*55, 0), 0)<\/p>\n\n\n\n<p>Add Right Icon and Down Icon to the Parent gallery and set the below expression to visible property of these icons.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Down Icon\nVisible = ThisItem.IsSelected\n\n\/\/Right Icon\nVisible = !ThisItem.IsSelected<\/code><\/pre>\n\n\n\n<p>After implementation of above steps, we able to expand and collapse on each country to show &amp; hide the child rows.<\/p>\n\n\n\n<p>Click <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/maker\/canvas-apps\/functions\/function-groupby\" title=\"here\">here <\/a>to know more about GroupBy function in PowerApps.<\/p>\n\n\n\n<p>Please post your queries in the comment section. Happy Building \ud83d\ude42 <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s try to build a PowerApps&#8217;s Nested gallery view using GroupBy function to achieve the Grouping functionality of SharePoint List We have used below sample data in Collection as a data source for the galleries used in this Nested Gallery Application and we can also use any data source to feed the data to gallery. Create the above collection with [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":1818,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[6,32,5],"tags":[12,70,71,33,9,30],"class_list":["post-1801","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-canvas-apps","category-power-platform","category-powerapps","tag-canvas-app","tag-group-by-in-power-apps","tag-nested-gallery","tag-power-platform","tag-powerapps","tag-sharepoint"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-2021-11-28-183835-e1638106039601.png?fit=872%2C424&ssl=1?v=1638104932","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1456,"url":"https:\/\/365stack.in\/index.php\/2021\/09\/17\/powerapps-print-form-to-pdf\/","url_meta":{"origin":1801,"position":0},"title":"How to Print Scrollable Screen to PDF in PowerApps","author":"Hemanthkumar Rajan","date":"September 17, 2021","format":false,"excerpt":"One of the common requirements in any application is to print the data either to save the form as PDF or print the form. PowerApps provides Print() function to print the screen in a printable format, but the limitation is the screen height cannot be greater than 2164px. If a\u2026","rel":"","context":"In &quot;Canvas Apps&quot;","block_context":{"text":"Canvas Apps","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/powerapps\/canvas-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2020\/10\/background1.jpg?fit=1200%2C675&ssl=1%3Fv%3D1623349406&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2278,"url":"https:\/\/365stack.in\/index.php\/2021\/12\/28\/how-to-send-json-data-to-canvas-apps\/","url_meta":{"origin":1801,"position":1},"title":"How to send JSON data to Canvas Apps","author":"Premkumar Perumal","date":"December 28, 2021","format":false,"excerpt":"We're going to explain how to send a JSON response from Power Automate to Canvas app and how to convert the response into Collection format in Canvas app. To illustrate, we have explained a small app as example. As First step, create a new Instant flow that can be triggered\u2026","rel":"","context":"In &quot;Canvas Apps&quot;","block_context":{"text":"Canvas Apps","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/powerapps\/canvas-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-2021-12-28-103100.png?fit=836%2C391&ssl=1%3Fv%3D1640667678&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1633,"url":"https:\/\/365stack.in\/index.php\/2021\/12\/29\/how-to-add-check-box-grouping-in-canvas-app\/","url_meta":{"origin":1801,"position":2},"title":"How to add check box grouping in Canvas App","author":"Hemanthkumar Rajan","date":"December 29, 2021","format":false,"excerpt":"Those who worked in SharePoint will be familiar with checkbox grouping because the \"choice column\" in SharePoint allows the Checkboxes option. It will be similar in SharePoint aligned BPM tools like Nintex and K2. Most of the BPM tools like Pega and even in Power Platform do not provide this\u2026","rel":"","context":"In &quot;Canvas Apps&quot;","block_context":{"text":"Canvas Apps","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/powerapps\/canvas-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-190.png?fit=769%2C471&ssl=1%3Fv%3D1638008855&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1527,"url":"https:\/\/365stack.in\/index.php\/2021\/11\/21\/how-to-create-custom-attachment-control-in-powerapps\/","url_meta":{"origin":1801,"position":3},"title":"How to create custom attachment control in PowerApps","author":"Hemanthkumar Rajan","date":"November 21, 2021","format":false,"excerpt":"Attaching a file along with the form is a common requirement, By default PowerApps does not provide any attachment control. But if the SharePoint list is added as a datasource automatically the attachment control will be generated along with the controls. But if multiple attachment control has to be shown\u2026","rel":"","context":"In &quot;Canvas Apps&quot;","block_context":{"text":"Canvas Apps","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/powerapps\/canvas-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-143.png?fit=1200%2C467&ssl=1%3Fv%3D1637483532&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1631,"url":"https:\/\/365stack.in\/index.php\/2021\/11\/27\/add-repeating-section-in-powerapps\/","url_meta":{"origin":1801,"position":4},"title":"Add repeating section in PowerApps","author":"Hemanthkumar Rajan","date":"November 27, 2021","format":false,"excerpt":"As we already discussed, Gallery is a multipurpose control in the canvas app. One of the use-cases of gallery is the repeating section, this scenario will be applicable between Parent-Child relationships in Lists or tables and if the form is converted from Nintex, InfoPath (OOTB repeating section control available there)\u2026","rel":"","context":"In &quot;Canvas Apps&quot;","block_context":{"text":"Canvas Apps","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/powerapps\/canvas-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/11\/Screenshot-197.png?fit=1045%2C267&ssl=1%3Fv%3D1637926841&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1221,"url":"https:\/\/365stack.in\/index.php\/2021\/07\/06\/a-complete-guide-for-migration-to-power-platform-pre-development-analysis-part-2\/","url_meta":{"origin":1801,"position":5},"title":"A Complete Guide for Migration to Power Platform: Pre-Development Analysis &#8211; Part 2","author":"Hemanthkumar Rajan","date":"July 6, 2021","format":false,"excerpt":"When it comes to migrating from existing technologies, a thorough study has to be done on the legacy tool starting from how the controls are used, what are the actions frequently used, things which are available in source and not available in the destination, etc. Solutions for these scenarios must\u2026","rel":"","context":"In &quot;Power Platform&quot;","block_context":{"text":"Power Platform","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/"},"img":{"alt_text":"Pre Development Analysis","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/07\/Requirement-Anlaysis-scaled.jpeg?fit=1200%2C829&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts\/1801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/comments?post=1801"}],"version-history":[{"count":19,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts\/1801\/revisions"}],"predecessor-version":[{"id":1823,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts\/1801\/revisions\/1823"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/media\/1818"}],"wp:attachment":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/media?parent=1801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/categories?post=1801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/tags?post=1801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}