-
Book Overview & Buying
-
Table Of Contents
Microsoft Power Apps Cookbook
By :
For every business process, there is always a step-by-step procedure that defines every requirement, objective, and resolution from start to end. Companies build on and improve these procedures depending on the business needs, and they even create departments to work exclusively on this.
Model-driven apps help set up these rules by providing several tools to define business logic on various platform levels. You can incorporate data validation rules and structured data flows to guide the end user, and even trigger workflows for defined events on your processes. These are just some examples of what you can achieve with this platform.
Let's improve our help desk app by adding business logic to the solution we created in the previous recipe:
Customer Validation column visible unless the case is in the Resolved state.Tickets table. Select the table and then click on Edit.Display Name: Customer validation visibility
Under Rules, set to check when Ticket Status equals Resolved or Closed, and then click on Apply.
Display Name: Show Customer Validation
Field: Customer Validation
Visible: Yes
Display Name: Hide Customer Validation
Field: Customer Validation
Visible: No
Customer validation visibility and then hit Save on the toolbar, and then on Activate to make it available for this table:
Figure 2.13 – Customer validation business rule
Ticket table and click OK:
Figure 2.14 – New BPF dialog
New, In Progress, Resolved, and Closed. For each one, click on Apply afterward.New:Data Field: Description
In Progress:Data Field: Description – Required
Resolved:Data Field: Resolution – Required
Closed:Data Field: Customer validation – Required
Once we have configured the business process logic for Tickets, every time this table gets invoked, it will carry on these defined components. To see them working, go to your solution, select the model-driven app, and click on Play; this will open the app on the Pending Tickets view. Click on New to add a ticket.
You will see that the form now includes your BPF, which lets you have a clear visualization of which step of the process your ticket is. After saving it, if you try to move beyond the Resolved stage, it will ask you to set the value for the required columns:
Figure 2.15 – BPF in action
As for the business rule, the Customer Validation column will remain hidden until the ticket status gets changed to Resolved. Once we enter this column's data, it is then that we can finish the BPF:
Figure 2.16 – Ticket processing completed