How to add 4 elements on a row to populate a 5th field

0
Hello, My group has four columns (below, acceptable, developed, exemplary) and we need to update a fifth field (total). We are trying to do this via Xpath. From the documentation we were a bit confused. We had the following: sum(below + acceptable + developed + exemplary) sum((below), (acceptable), (developed), (exemplary)) And we tried combination after combination to no hope. How do we successfully set up this task with an Xpath? Any direction would be great. If you need more clarity then let me know. I really appreciate it.
asked
4 answers
1

Mark,

If you have an entity defined like this:

and want to set the value of the Combined attribute in a microflow Change Object Activity, you would do it this way:

However, I am not sure why you are using Xpath - maybe I don't understand what you are trying to accomplish.

Mike

below + acceptable + developed + exemplary

This will work as long as each of those 4 attributes is numeric.

 

answered
0
  1. If the calculation logic is always same, you can also try to use the Entity Before commit or Before create Events (as applicable).  So, when you use the commit activity, you value for 5th column will be automatically committed to database and shown in page. 
  2. If you still want to do this from your page, I am not sure why you want to do an On Change for all four fields? If you have a Save action button at the end of the page, you can still get all four fields and sum up to the 5th one. Use onchange, only if you have any further manipulation to do based on the 5th column on the same page before committing. 
  3. In commit, make sure you also refresh the client, so when the page is loaded after Microflow, you see refreshed data.
answered
0

For the user-experience it is nice to update the sum field on every change of the underlying attributes. 

Don't know why you would want to solve it in the xpath. It totally works fine, even with an xpath data source in the way Mark explained.

answered
0

Since it is 7.13, this is a perfect usecase for a nanoflow. See https://question89511.mxapps.io/index.html?profile=Responsive

Click the any line of the datagrid. The dataview below has a this nanoflow connected to the onchange of the below and the Accepted field.

 

Advantage of the nanoflow over the microflow in this case is the nanoflow not triggering a roundtrip and thus being lightning fast.

answered