How can i count the number of fields in an infopath form which have the selection "completed" selected

1.4k Views Asked by At

I created a large number of choice columns in Sharepoint which all have 3 answers "Select, "Completed" and "Not Required".

I had then edited the sharepoint Custom list in infopath to add our standard design etc. I have added all the sharepoint fields to the infopath form and now I want to create a % complete display at the top of the infopath form which calculates how many of the choice fields have "completed" selected.

How can I achieve this?

1

There are 1 best solutions below

0
teylyn On

You need a helper field and then create rules that evaluate and sum up the fields whenever one of the fields is changed. The calculation for the helper field is along the lines of ...

(my:Field1 = "Completed") + (my:Field2 = "Completed") + (my:Field3 = "Completed") + (my:Field4 = "Completed") + (my:Field5 = "Completed") + (my:Field6 = "Completed")

Each comparison will yield either a true or a false, which will be coerced into a 1 or a 0 with the plus operator. You know how many fields you have, so you can work out the percentage with (HelperFieldValue / NumberOfFields)*100 in a calculated value on the canvas.