# Toggle Field compbined with if to customize text based on single/multiple selected, stuck

**URL:** <https://community.blaze.today/t/toggle-field-compbined-with-if-to-customize-text-based-on-single-multiple-selected-stuck/33550>\
**Category:** Questions and Help\
**Created:** [November 9, 2023, 7:25pm UTC](https://community.blaze.today/t/toggle-field-compbined-with-if-to-customize-text-based-on-single-multiple-selected-stuck/33550 "2023-11-09T19:25:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Gouge](https://community.blaze.today/user_avatar/community.blaze.today/brian_gouge/32/1336_2.png) [@Brian\_Gouge](https://community.blaze.today/u/Brian_Gouge)\
**Post date:** [November 9, 2023, 7:25pm UTC](https://community.blaze.today/t/toggle-field-compbined-with-if-to-customize-text-based-on-single-multiple-selected-stuck/33550/1 "2023-11-09T19:25:56Z")

</div>

I want to customize the string above the toggle fields based on whether we select one or multiple calendly links. If we select more than one of the toggle fields, I want to word it differently so the customer knows they should schedule _only one appointment_ in whichever of the following calendars they can find a time that works for them.  
I am stuck on how to craft an if statement that takes the list of toggle field names, everything I try tells me it can't count or compare "yes". I am not able to make the leap from the formtoggle evaluating as "no" or "yes" to counting whether the sum of list of them all is \>1

You may schedule a time that works for you using the following:  
{formtoggle: name=Harry; default=no}[https://calendly.com/harrypotter{endformtoggle}](https://calendly.com/harrypotter%7Bendformtoggle%7D)  
{formtoggle: name=Ron; default=no}[https://calendly.com/ronweasley{endformtoggle}](https://calendly.com/ronweasley%7Bendformtoggle%7D)  
{formtoggle: name=Hermoine; default=no}[https://calendly.com/hermoinegranger{endformtoggle}](https://calendly.com/hermoinegranger%7Bendformtoggle%7D)

{=harry}  
{=ron}  
{=hermoine}

example: {if: count([harry,ron,hermoine])}one{else}two{endif}  
results in " Cannot convert "3" to yes or no."

We prefer toggle fields because vs a dropdown menu it doesn't require extra clicks to pull down the dropdown, but I can't get it to work with a dropdown instead either. I'm just stuck, can anyone help please?

---

<div class="post-metadata">

**Author:** ![Dan\_Barak1](https://community.blaze.today/user_avatar/community.blaze.today/dan_barak1/32/2322_2.png) [@Dan\_Barak1](https://community.blaze.today/u/Dan_Barak1)\
**Post date:** [November 10, 2023, 12:56am UTC](https://community.blaze.today/t/toggle-field-compbined-with-if-to-customize-text-based-on-single-multiple-selected-stuck/33550/2 "2023-11-10T00:56:26Z")

</div>

Hi @Brian_Gouge  
How about this:

{formtoggle: name=Harry; default=no}[https://calendly.com/harrypotter{endformtoggle}](https://calendly.com/harrypotter%7Bendformtoggle%7D)  
{formtoggle: name=Ron; default=no}[https://calendly.com/ronweasley{endformtoggle}](https://calendly.com/ronweasley%7Bendformtoggle%7D)  
{formtoggle: name=Hermoine; default=no}[https://calendly.com/hermoinegranger{endformtoggle}](https://calendly.com/hermoinegranger%7Bendformtoggle%7D)

{=harry}  
{=ron}  
{=hermoine}  
count: {=sum(map([harry,ron,hermoine], x-\>1 if x else 0))}  
example: {if: sum(map([harry,ron,hermoine], x-\>1 if x else 0))\<=1}one{else}two{endif}

---

<div class="post-metadata">

**Author:** ![Brian\_Gouge](https://community.blaze.today/user_avatar/community.blaze.today/brian_gouge/32/1336_2.png) [@Brian\_Gouge](https://community.blaze.today/u/Brian_Gouge)\
**Post date:** [November 10, 2023, 4:09pm UTC](https://community.blaze.today/t/toggle-field-compbined-with-if-to-customize-text-based-on-single-multiple-selected-stuck/33550/3 "2023-11-10T16:09:46Z")

</div>

> [@Dan\_Barak1](#):
>
> count:
> 
> =
> 
> sum(map([harry,ron,hermoine], x-\>1 if x else 0))
> 
> example:
> 
> if
> 
> sum(map([harry,ron,hermoine], x-\>1 if x else 0))\<=1
> 
> one
> 
> else
> 
> two

Yes thank you, the magic sauce I couldn't come up with is the sum and map combo and this works great. Thanks so much!
