Back to Basics # 14: Business Rules with Actions Set Default Value and Set Field Value in Model Driven Power Apps

Introduction:

In Dynamics 365 CRM or Power Platform, Business rules provide a quick way of applying business conditions every business rule starts with a condition. In this article we are going to see about 2 Actions Set Default Value and Set Field Value with a business scenario on contact entity if Vaccination is done, then a discount of 50% is given to contact else no discount.

Step 1:

Login to the required Dynamics CRM/ Power Apps environment using URL make.powerapps.com by providing user name and password and go to solutions as shown in the below figure.

Step 2:

After Step 1, select custom solution here select ContactCustomizations custom solution as shown in the below figure.

Step 3:

After Step 2, in ContactCustomizations custom solution open Contact Entity and then click on Business Rules tab and then Click on Add business rule as shown in the below figure.

Step 4:

After Step 3, a new Business rule window get’s opened up provide Business Rule name and meaningful description and provide condition if Vaccination field have yes as shown in the below figure.

Step 5:

After Step 4, if Vaccination value is yes then drag and drop Set Field values against to Condition and then keep Set Field Value for Discount field as 50 if Vaccination is not taken then keep another condition and verify if Vaccination value is No or None set Field Value for Discount field as 0 as shown in the below figure.

Step 6:

For Set Field Value Give 50 % Discount provide the values also provide in the same way Set Field value for the 2nd condition as 0 as shown in the below figure.

Step 7:

After Step 6, in the else part of 2nd Condition if user did not select any vaccination value then assign the default value as 0 by selecting Set Default Value by drag and drop it  as shown in the below figure.

Step 8:

After Step 7, save Business Rule, provide the scope as Entity and Activate this Business rule and look for any validation errors by clicking in Validation link as  shown in the below figure.

Step 9:

After Step 8, let us test this Business rule open any contact record and verify if vaccination is Yes then discount is shown as 50   shown in the below figure.

Step 10:

After Step 9, for the same contact record, verify if vaccination is No or None  then discount is shown as 0   shown in the below figure.

Note:

  1. Please make sure you keep the required fields on Contact Form.
  2. Select fields for Actions as well as for Conditions without fail.
  3. Make sure to Activate Business Rule after save.
  4. Publish all changes without fail.
  5. Give name of conditions and Actions names in a meaningful way.

Conclusion:  In this way one can easily perform Business validations with Set Default Value and Set Field Value Actions in few minutes can be built.

One thought on “Back to Basics # 14: Business Rules with Actions Set Default Value and Set Field Value in Model Driven Power Apps

  1. Pingback: Rewind August 2021 – Common Man Tips for Power Platform, Dynamics CRM,Azure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s