Expand my Community achievements bar.

Come join us for our Coffee Break this WEDNESDAY on top takeaways from Adobe Summit!

Create count of custom field with checkboxes

Avatar

Level 2
I have a custom form with a custom field where a requestor selects the products PDFs need to be created for. Is there a way to create a custom field that will count the number of products selected? Example: person selects product 1, product 5, product 6 for PDFs and I'd like the new custom field to show 3 PDFs requested vs asking the individual to fill in a field with 3.
9 Replies

Avatar

Level 10

Hi Leanne,

What sort of custom field/fields do you have currently?

Is it a single drop-down box which allows multiple items to be selected? If so, I'm not sure how you could sum the multiple selections but someone else may have an idea.

Or, do you have multiple custom fields (one for each PDF), each with something like a "Yes" checkbox? If you were to go down this path, you would set each check-box field to be a number field and click "show values" and set a value of 1 that corresponds to "Yes". Then create a calculated field that sums the total value of the checkbox fields. Please see sample screenshot of such a setup attached below.

Regards, David0690z000007ZkFTAA0.png

Avatar

Level 5

Not super elegant but you can check the field for each substring and sum the results in a calculated number field

I created a simple checkbox named Multiselect with AA BB CC DD EE as the 5 choices and then counted them with this code:

SUM(IF(CONTAINS("AA",Multiselect),1,0),IF(CONTAINS("BB",Multiselect),1,0),IF(CONTAINS("CC",Multiselect),1,0),IF(CONTAINS("DD",Multiselect),1,0),IF(CONTAINS("EE",Multiselect),1,0))

--

Melinda Layten, Senior Consultant

0690z000007ZkFEAA0.png

Avatar

Level 10
Ah, but full points for Super Effective, Melinda. Nice technique. Regards, Doug

Avatar

Level 10
Yep - that's a good solution! :)

Avatar

Level 5
Hopefully someone sees this: where do you add this text? Jazmin Allen-Collins Analog Devices, Inc.

Avatar

Level 6
As Melinda mentioned, she has 2 fields: One for the checkboxes and One that is a calculated field for the number of boxes checked. Create a calculated field on your form that counts the number of boxes checked in the field in question. Marty Gawry - CapabilitySource CapabilityBlox

Avatar

Level 4
Here's another way to do it: https://community.workfront.com/discussions/community-home/digestviewer/viewthread?MessageKey=30cf64... -- Melinda Layten, Senior Consultant Work Management Improvement CapabilitySource Phone: (484) 505-6855 site: www.capabilitysource.com email: melinda.layten@capabilitysource.com Helpful? Buy me a coffee: https://www.patreon.com/mlayten - we simplify your work so you can run your business -

Avatar

Community Advisor
Has anyone come up with another way to do this. The suggestions in this thread look good, but my field has 156 options that can be selected (with more added fairly regularly), making the IF or SUM statements cumbersome.

Avatar

Level 10
Hi Heather, Just brainstorming here, so I haven't tried this, but could you use the COUNT statement (probably with the IF statement) and use the Values for your selections? If you set the value of each selection to a number in sequence (and they have to be unique). Then you could possibly do a COUNT for any value less than 200 (this gives you room to grow – or put it higher if you wish). And if that won't work for whatever reason, perhaps using the values as least streamlines your IF statement. Again I haven't tested this, but might be worth a try. Many people don't know about the Values field in the custom form. If you select the field in the form, select Options > Show Values you'll see what I'm talking about (see attached). Then those values can be used instead of the Selection name itself. Just a thought.