How to Apply Business Rules to the Model-driven Forms

| Aqsa Nabi

Power Platform is an ideal tool for developing custom solutions for businesses, fulfilling the market gaps, that too with basic knowledge. The users do not necessarily need coding skills to be able to establish a deal-breaking app using the Power Apps. There are very approachable ways that the Power Platform provides to design the solutions that would fit business needs.

One of the key functional requirements, for the applications, is the logic-based behavior of the form fields which usually take up much more effort when using scripts to customize this feature. With Power Platform Model-driven, it is a very simplified process and does not occupy time as compared to the scripting, which includes identifying the field path first, and then implementing the logic – which has more chances of errors and could become a big hassle during the testing phase.

Configure Business Rules in Model-driven App:

First things first, it is important to have the correct security role assigned to the user, which is the ‘System Administrator’ role – to have all the privileges and be able to perform required operations in the solution.

To create a business rule to hide and unhide form fields based on the option selected in one field - follow the steps mentioned below and use the drag-and-drop functionality .

  • Log in to the Power Platform environment and open the solution you would like to work in.
  • Navigate to the table which contains the form in which you want to configure the business rules.

Environment-Variables-in-Canvas-Apps

  • Click the table name to expand it and navigate to the ‘Business rules’ view
  • Click ‘Add Business Rule’ on the ribbon

Environment-Variables-in-Canvas-Apps

  • The system opens ‘Business Rules Designer’ in the new tab which has a mini map at the bottom of the screen.
    • The system has a Condition tile present on the map, so select the condition and click on the ‘Properties’ tab on the left pane.
    • Provide the Condition Name
    • Select the Entity on which you want to apply the rule
    • In the Rules section > Select the Source > Select the form field > Select the conditioning operator > Pick the type from the available options that have been configured based on the type of field > Select the value on which the condition should apply.
    • Click the ‘Apply’ button

Environment-Variables-in-Canvas-Apps

  • The Business Rule (Text View) displays the logic that is being built while you configure the condition.
  • Switch the tab to ‘Components’ > Drag and drop the ‘Set Visibility’ component to the map on the + area.

Environment-Variables-in-Canvas-Apps

  • In the Properties tab, provide the action that should be performed by the system when the option set in the condition is selected.
    • Provide ‘then’ condition if there are no other actions that should execute based on the action already selected.
    • User else condition if there are other fields that should show when the condition fulfills.

Environment-Variables-in-Canvas-Apps

Environment-Variables-in-Canvas-Apps

NOTE: The mini-map shows the overall business rule look for excluding confusion in the expanded mode and the text view provides in-depth visibility of the condition being built.

  • You can also provide the condition name by expanding the header and filling the ‘Business rule name’ field and ‘Description’

Environment-Variables-in-Canvas-Apps

  • Click ‘Save’ and then ‘Validate’ on the command bar to verify the condition.

Environment-Variables-in-Canvas-Apps

  • Click ‘Activate’ to let the business rule take effect on the solution. Click ‘Activate’ on the popup. This button changes the form to read only mode. Click ‘Deactivate’ button to edit the business rule and click ‘Activate’ again.

Environment-Variables-in-Canvas-Apps

Try this at your own solution and create multiple other business rules using other available components!

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