{"id":13053,"date":"2018-10-01T18:30:38","date_gmt":"2018-10-01T13:00:38","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=13053"},"modified":"2018-10-01T18:30:38","modified_gmt":"2018-10-01T13:00:38","slug":"powerapps-alter-components-properties-based-off-of-other-fields-value-using-rules","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2018\/10\/powerapps-alter-components-properties-based-off-of-other-fields-value-using-rules\/","title":{"rendered":"PowerApps \u2013 Alter Component(s) properties based off of other field(s) value using Rules"},"content":{"rendered":"<h2 style=\"text-align: left;\"><strong>Introduction:<\/strong><\/h2>\n<p style=\"text-align: justify;\">We all know, PowerApps, helps you build business apps.<\/p>\n<p style=\"text-align: justify;\">The potential that PowerApps beholds is humongous.<\/p>\n<p style=\"text-align: justify;\">PowerApps can help us build an app as basic as a Survey App or maybe a complex one which could have a potential of being a calculator.<\/p>\n<p style=\"text-align: justify;\">Well! This blog post is dedicated to describing one of the most basic yet powerful piece of PowerApps, \u201cRules\u201d.<\/p>\n<p style=\"text-align: justify;\">Consider a scenario, you have a Survey App where based on the value of one field you need to show\/hide another field.<\/p>\n<p style=\"text-align: justify;\">To achieve this, it is as simple as creating a Business Rule in Dynamics 365 Customer Engagement.<\/p>\n<p style=\"text-align: justify;\">Let\u2019s dive into the nitty-gritty of it.<\/p>\n<p style=\"text-align: justify;\">So, we have a field on the Survey App called \u201cReason why you like us?\u201d (As shown in the below screenshot) it is a drop-down field. If the user were to select the value \u201cOthers\u201d, it\u2019ll show a text area for the user to write down his comments. If the user selects any other value then the text area for the comments would get hidden.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-13064 aligncenter\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/1PowerApps.png\" alt=\"1PowerApps\" width=\"472\" height=\"438\" \/><\/p>\n<p>Let\u2019s see how to achieve this,<\/p>\n<h2>Step 1:<\/h2>\n<p>Select your component (in my case it is the Text Area), go to the Rules section on the right-hand side, click on + New rule.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13065 \" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/2PowerApps.png\" alt=\"PowerApps \u2013 Alter Component(s) properties based off of other field(s) value using Rules\" width=\"966\" height=\"397\" \/><\/p>\n<h2>Step 2:<\/h2>\n<p>You\u2019ll get a screen, type in your condition. In my case, I wanted to base my logic off of the Drop-Down value. If \u2018Others\u201d is selected show the Text Area otherwise hide the Text Area.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-13066  alignnone\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/3PowerApps.png\" alt=\"PowerApps \u2013 Alter Component(s) properties based off of other field(s) value using Rules\" width=\"584\" height=\"290\" \/><\/p>\n<h2>Step 3:<\/h2>\n<p>Now, comes the step to apply our Action. Click on Define actions, it\u2019ll take you to the app screen.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-13067  alignnone\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/4PowerApps.png\" alt=\"PowerApps \u2013 Alter Component(s) properties based off of other field(s) value using Rules\" width=\"354\" height=\"152\" \/><\/p>\n<p>Here, you need to select the field on which you want to perform the action (in my case it the text area) and also we need to define the action (in my case it to set the visibility).<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13068 \" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/5PowerApps.png\" alt=\"5PowerApps\" width=\"972\" height=\"396\" \/><\/p>\n<p>In order to set the action to Visibility True, click on the Visible property (you might have to toggle the value in order to get your desirable output) on the right hand side and then click on Done at the top.<\/p>\n<p>Once, it is done, you\u2019ll see the action as below.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-13069  alignnone\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/6PowerApps.png\" alt=\"6PowerApps\" width=\"615\" height=\"287\" \/><\/p>\n<h2>Step 4:<\/h2>\n<p>It\u2019s time to define the else part of the above logic.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-13071 \" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/8powerapps.png\" alt=\"8powerapps\" width=\"374\" height=\"394\" \/><\/p>\n<p><strong><em>Note:<\/em><\/strong><\/p>\n<ul>\n<li>We can group multiple fields in the condition to alter the properties of another field.<\/li>\n<li>Currently, the conditions don\u2019t support ThisItem property, which we usually use in a gallery or form.<\/li>\n<\/ul>\n<h2><\/h2>\n<h2><strong>Conclusion:<\/strong><\/h2>\n<p>Following similar steps, you can alter not only the visibility but all the properties of a component.<\/p>\n<p><a href=\"https:\/\/www.maplytics.com\/miscellaneous\/google-maps-dynamics-crm-turn-turn-gps-navigation\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-13072 \" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2018\/10\/google-maps-dynamics-crm-turn-turn-gps-navigation1.png\" alt=\"google-maps-dynamics-crm-turn-turn-gps-navigation\" width=\"969\" height=\"242\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>Introduction: We all know, PowerApps, helps you build business apps. The potential that PowerApps beholds is humongous. PowerApps can help us build an app as basic as a Survey App or maybe a complex one which could have a potential of being a calculator. Well! This blog post is dedicated to describing one of the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2018\/10\/powerapps-alter-components-properties-based-off-of-other-fields-value-using-rules\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":13070,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,18,19,44,38],"tags":[572,1101,1170,1354],"class_list":["post-13053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365","category-dynamics-365-v9-2","category-dynamics-crm","category-power-apps","category-microsoft-powerapps","tag-dynamics-365-powerapps","tag-microsoft-dynamics-365-powerapps","tag-microsoft-powerapps","tag-powerapps-dynamics-crm"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/13053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=13053"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/13053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/13070"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=13053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=13053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=13053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}