Calculated fields in Power Apps.

Hello Guys,

In my previous blog we have seen how you can use OOB feature to create auto numbering or auto generated field value. Today we are going to explore one more OOB feature of the Dynamics CRM i.e. Calculated Fields. But before if you are new to our blog then do follow us to know more about Dynamics and Power Platform. Also if you like our blog then please comment and share this blog with your friends.

Calculated fields are used to perform calculation using data available in other fields. Microsoft Power Platform provides large set of inbuilt functions to work with calculated fields.

Consider a scenario where we have Employee entity with Left Date attribute. Now we want whenever employee leaves the organization, this field should contain date value in it. Which means initially this field will be blank but when we will deactivate the employee, this field should contain data.

To achieve this many of us go with JavaScript implementation which is not a good practice as we should use OOB features.

Power Platform gives us a field type option that we can use to calculate field's value. This field type option is known as Calculated fields. Calculated fields uses following datatype: Text, Option Set, Two Option, Whole Number, Decimal Number, Currency and Date Time.

There is a limit to the amount of calculated field per entity. It is important to check your software version to determine how many calculated fields you can create before implementing them.

One important point that we need to keep in mind that Calculated field can not trigger Workflows. Attempting to call workflows on the change of a calculated field will not work. Below are the steps for creating Calculated field.

Step 1:- Login to https://make.powerapps.com



Step 2:- Open Employee Entity. Here we have created Employee Entity with below fields. We will be creating a new field i.e. Left Date.



Step 3:- To create a new field click on New Field at the top. Fill the information as below and click on Add and select Calculation. It will open a new window.



Step 4:-We will specify the condition that if Employee's status reason is inactive, we will set current date for the leaving the organization.



Step 5:- Save and Close. Now open the Employee record and deactivate it and check its working as expected.


Please follow and share if you like it.
Hope it helps...

Comments

Post a Comment

Popular posts from this blog

Creating Custom API in D365.

Read Only Sub Grid & Editable Sub grid in Dynamics 365

Using Polymorphic Lookups in D365.