Business Rules in PowerApps

| Zoha Zulfiqar

A business rule is an easier and quicker way of applying logic and validations to an entity’s fields without any complex Javascript web resource or plug-ins. It has a simple interface where you can easily drag and drop different conditions and the actions you want to perform based on those conditions.

Here is a list of functionalities that business rules can perform:

  • Set values of a field
  • Clear values of a field
  • Set field requirement levels
  • Show or hide fields
  • Enable or disable fields
  • Validate data and show error messages
  • Create business recommendations based on business intelligence.

Let’s create a simple business rule and see how it works.

So I have created an entity called Contact Details and I want to apply a business rule to it for showing or hiding a field based on another field’s value.

First, navigate to the Contact Details entity – Business Rules – click on Add business rule. A new screen will open up for the configuration of business rule.

Here I can give a title to business rule and add a description as well.

BusinessRules

Now there are conditions and actions in the right hand tab that I can drag and drop to the main canvas, then go to properties to specify the condition or the action I want to perform. For Show/Hide Fields business rule, I have added a few conditions and action as you can see in the picture below.

BusinessRules

So my purpose was to show Email field when the Contact field is set to Email and to show the Phone Number field when the Contact field is set to Phone Number. Here is the text version of the business rule:

BusinessRules

After applying all the necessary conditions and action, click on save and then validate.

BusinessRules

And then click on Activate. If I don’t activate the business rule, it will not work.

BusinessRules

Now let’s see the business rule in action with in the model-driven app that I created for Contact Details entity. When I first open the Main Form of Contact Details, only two fields are visible – Name and Contact.

BusinessRules

If I set Contact field to Email, then the Email text field becomes visible and if I set the Contact field to Phone Number, then the Phone Number field becomes visible. It proves that the business rule is working as it should be.

BusinessRules BusinessRules

Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.


M
Chief Architect, Founder, and CEO - a Microsoft recognized Power Platform solution architect.

About The Blog

Stay updated with what is happening in the Microsoft Business Applications world and initiatives Imperium is taking to ease digital transformation for customers.


More About Us

We provide guidance and strategic oversight to C-Suite and IT Directors for on-going implementations. Feel free to give us a call.

1 331 250 27 17
Send A Message

Ready to Start?

Get a personalized consultation for your project.

Book a Meeting