{"id":80,"date":"2021-09-12T10:23:52","date_gmt":"2021-09-12T02:23:52","guid":{"rendered":"https:\/\/pearsongang.com\/?p=80"},"modified":"2021-09-12T10:23:57","modified_gmt":"2021-09-12T02:23:57","slug":"power-apps-fission-dev-part-3","status":"publish","type":"post","link":"https:\/\/pearsongang.com\/?p=80","title":{"rendered":"POWER APPS &#8211; FISSION DEV &#8211; Part 3"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pearsongang.com\/wp-content\/uploads\/2021\/08\/Fission-Dev.png?w=640&#038;ssl=1\" alt=\"This image has an empty alt attribute; its file name is Fission-Dev.png\"\/><\/figure><\/div>\n\n\n\n<p class=\"has-normal-font-size\"><strong>Level:<\/strong> Orange         (on scale of white, yellow, orange, &#8230;, black)<\/p>\n\n\n\n<p><strong>Very Basic Themes<\/strong><\/p>\n\n\n\n<p>Last time we discussed &#8220;<strong>Nucleus: First Field on Screen<\/strong>&#8220;, this time we extend  the concept by introducing themes.<br>Microsoft have introduced a great theming method. However, I feel this may be a little cumbersome for the newbie.<br>This method suggested below is vey basic and also introduces some basic Power App concepts. In the longer term, I hope to return to the themes (per Microsoft).<\/p>\n\n\n\n<p>Before we discuss themes the critical concept of variables and collections need to be discussed. I am not going to explain this concept (many blogs and articles have addressed this)<\/p>\n\n\n\n<p><strong>Variables and Collections<\/strong><\/p>\n\n\n\n<p>Variables are critical to Power Apps. They are very powerful and source of errors. So it is important to be very meticulous. Power Apps has the concept of local and global variables. Unfortunately this does not extend to collections. All collections are global in nature. This global nature in turn becomes a source of many errors.<\/p>\n\n\n\n<p><strong>Variables:<\/strong><\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Global <\/span>: Uses the &#8216;Set&#8217; syntax, for example<br><br>Set (g_versionNo , &#8220;V1.0.0.0&#8221;)<\/p>\n\n\n\n<p>Where  g_versionNo   is the global variable<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><span style=\"text-decoration: underline;\">Local<\/span>: Uses the &#8216;UpdateContext&#8217; syntax, for example<br><br>UpdateContext({ l_count_mnu: 1}) <\/p>\n\n\n\n<p>where  l_count_mnu  is the local variable<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Collections<\/strong><\/p>\n\n\n\n<p>Collect (g_colPeople, Filter(tblPeople , lastname = &#8220;Bloggs&#8221;))<\/p>\n\n\n\n<p> where   g_colPeople is the collection <\/p>\n\n\n\n<p>There is no alternative syntax for local collections.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Naming Collections Conventions<\/strong><\/p>\n\n\n\n<p>To overcome this shortcoming, my suggestions is to name collections to identify the scope.<br>For example prefix<br><br>g_col &#8211; is used to identify collection as global collection<br>l_colPerson_mnu &#8211; is used to identify the collection as local. The suffix &#8220;_mnu&#8221; identifies the screen that the collection, relates to. in this scenario the menu screen.<\/p>\n\n\n\n<p>I also go one step further: if a collection is usedin a single event (function) then my naming convention is<br>t_colPeople_mnu where t_ identifies the collection as limited to a function.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p> <strong>Naming Collections Variables<\/strong><\/p>\n\n\n\n<p>Similar to above I use same prefix and suffix to label variables:<\/p>\n\n\n\n<p>g_versionNo is a global variable<br>l_calcRate_inv is a local variable used in the &#8216;invoice screen&#8221;<br>t_id_inv is a temporary variable used in a single function on the &#8220;invoice&#8221; screen<\/p>\n\n\n\n<p><strong>Basic Themes<\/strong><br>This will be deferred until next time as this blog is already long.<br><br>To finish off my pet hate regarding variables is two fold:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>1) watching YouTube videos where &#8216;Set&#8217; is used and should be &#8216;UpdateContext&#8217;<br>2)  watching YouTube videos where  variable name have no meaning<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Level: Orange (on scale of white, yellow, orange, &#8230;, black) Very Basic Themes Last time we discussed &#8220;Nucleus: First Field on Screen&#8220;, this time we extend the concept by introducing themes.Microsoft have introduced a great theming method. However, I feel this may be a little cumbersome for the newbie.This method suggested below is vey basic [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12,14,1],"tags":[21,10,19,20],"class_list":["post-80","post","type-post","status-publish","format-standard","hentry","category-canvas-app","category-suggestions","category-uncategorized","tag-collections","tag-power-apps","tag-syntax","tag-variables"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":4,"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":84,"href":"https:\/\/pearsongang.com\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions\/84"}],"wp:attachment":[{"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pearsongang.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}