Count multiple entries in people picker with a calculate field (getting "18" when only one entry)

  • 29 July 2021
  • 1 reply

So I have a form with a people picker field that is an "assigned to" field. I need to know how many are assigned to a task. I used a calculated field with the following fx:

count(Assigned To) 

It gives the right answer if I have two or more assigned; however, It will return 18 when I have only one entry.

Any Ideas?


Best answer by pjbro1965 30 July 2021, 14:45

View original

1 reply

Found the answer /
Look up User picker count
This is what they said:

user picker count

In Nintex form Once I add Technician(s) which is User field in ManPwr. Techs: which is Number column I want to display the total no of technicians. Could you please suggest how I can doable in Nintex Form.

‎11-22-201510:42 PM
Re: user picker count
You should be able to do the count using Runtime functions count() in a Calculated Value control, it does seems like a bug when you select single people, it doesn't show the count of 1. But you can use the workaround below:

1. Give your People Picker control a name, in this case, I called it Technician.
2. Drop a Calculated Value control, and in the Formula, key in the following: (you need to select your Technician token from the Named Control tab)

If(Array.isArray(Technician),count(Technician),If(count(Technician) > 0,1,0))

When you put the token Technician into the formula, at runtime you can see when you selecting 2 or more, it will give you array result, while selecting 1, it will give you string, with that in mind, we use the formula I gave, to check if is array, if it is, then the count() will work just fine, if it wasn't, then the count() will give you character count of the selected people, since we know this behavior, we know there is only 1 people selected.
Hope it helps.