Transcript:
0:00 complex rules are often required to be
0:02 executed as part of the canvas power rep
0:04 and North52's Business rules engine for
0:06 Microsoft Dynamics 365 and the Power
0:08 Platform is a perfect partner for this
0:10 scenario
0:12 in this video we'll show you how you can
0:13 calculate a heart disease risk score as
0:15 part of a canvas PowerApp using the
0:17 following components a canvas power-up a
0:20 global action and the North52 business
0:23 rules engine
0:24 although the North52 solution is
0:26 installed in Microsoft database we will
0:28 not be saving any data and database as
0:30 part of the calculation this shows how
0:32 North52 can be used for stateless
0:34 processing
0:36 let's first see the canvas power up in
0:38 action and then review the components we
0:40 select the options on the app and click
0:42 the calculate risk button the North52
0:44 business rules assess the information
0:46 and return results we can see that we
0:49 have a high risk for these specific risk
0:50 areas
0:53 to make this work we first need to
0:54 create a global action which has two
0:56 parameters an input defined as payload
0:59 in Risk parameters Json and an output
1:02 defined as payload out risk results Json
1:04 we then bind this action to a North52
1:07 formula and decision logic is based on
1:09 the information passed from the canvas
1:11 app the first decision sheet determines
1:13 whether there is a smoke risk based on
1:15 any of the three criteria being met
1:18 the values for these criteria are
1:20 extracted from the Json data provided
1:22 from the canvas app we do this on the
1:24 global calculation sheet where values
1:26 from the payload in Risk parameters
1:28 adjacent input parameter are mapped so
1:30 that they can easily be referenced in
1:32 the decision sheets
1:33 firstly the payload and risk parameters
1:36 Json input parameter is assigned to the
1:38 North52 internal variable called
1:40 response content
1:41 then the individual values are assigned
1:43 for example current smoker is assigned
1:46 on row 4. all these values are used on
1:49 the decision sheets to determine risk
1:50 for each category we won't dwell on the
1:52 individual Logic for each sheet but
1:54 instead focus on the risk score sheet
1:56 which determines the risk and Associated
1:58 messages column J is an incremental
2:00 inline calculation which is adding a
2:02 value of 1 for each risk matched and
2:05 subtracting one in the case of the HDL
2:07 mitigating vector
2:08 column K is an inline calculation that
2:11 calls a parameterized global action
2:13 cell K4 shows the build Json Global
2:16 action with the first parameter having
2:18 the text smoke risk and the second
2:20 parameter with the text the patient has
2:23 a smoke risk on the global action sheet
2:25 we can see the build Json action defined
2:28 to append each message to an array the
2:30 risk type and message properties being
2:33 set by information passed in its
2:35 parameters replacing the 0 and 1 within
2:37 the curly brackets an example of the
2:40 output would look like this
2:42 the next part to look at is the canvas
2:44 app and how the calculation is called
2:46 and the results displayed there are two
2:48 important parts to review the on Select
2:51 Property of a button to collect the
2:53 values and submit them to the custom
2:54 action and the data table which shows
2:56 the messages that have been returned as
2:58 part of the Json response
3:01 let's look at the detail of the on
3:02 Select Property the values from many
3:05 input objects are collated in a
3:07 collection called formula data
3:09 this formula data collection is passed
3:11 to the custom action as Json using the
3:14 environment language object
3:16 the custom action triggers the North52
3:19 formula and Returns the results as Json
3:21 which is stored in the payload out risk
3:24 results Json variable
3:27 we then parse the Json to set the risk
3:29 score variable
3:31 and finally we parse the Json and add
3:33 the risk messages array to a collection
3:36 called risk messages
3:38 this data table is shown using the risk
3:41 messages collection it shows the risk
3:43 type and Associated message for each
3:46 risk identified
3:48 if you'd like to know more please review
3:50 the associated article on our support
3:52 portal and get in touch to see how we
3:54 can help you with your complex business
3:55 rules requirements from the Dynamics
3:57 platform also please don't forget to
4:00 subscribe to our YouTube channel
