Can `When` field accept multiple answers?

I can’t find documentation for this in the references but is it possible for the when field to take multiple options to show the same field?

Here’s my code:

              platform:
                label: Platform
                type: select
                required: yes
                options:
                  instagram: Instagram
                  patreon: Patreon
                  email: E-mail
                  vimeo: Vimeo
                  youtube: Youtube
              link:
                label: Link
                type: url
                required: yes
                when: 
                  platform: |
                  'instagram', 'patreon', 'vimeo', 'youtube
              email:
                label: Email
                type: email
                when: 
                  platform: email

Is something like this possible or would it require creating a custom field?

The when option is currently not super flexible and only accepts a single value.

Ah alright, thanks for letting me know.
Following up on this, if when only accepts one value, could link be hidden when email is selected?

If not, Would there be a way you’d suggest for changing the field to an e-mail type when email is selected?

Unfortunately, the current state of affairs doesn’t support your use case, I’m afraid.

That’s okay, I ended up creating a toggle asking if it’s an e-mail or not.

              emailToggle:
                label: Is this an E-mail? 
                type: toggle 
                default: no
                text: 
                  - "No"
                  - "Yes"
                width: 1/2
              link:
                label: Link
                type: url
                required: yes
                width: 1/2
                when: 
                  emailToggle: no
              emailLink:
                label: Email Link
                type: email
                required: yes
                before: 'mailto:'
                width: 1/2
                when: 
                  emailToggle: yes

Thanks for the help!

Are these fields inside a structure field?

Yes, that’s currently the best way if you don’t want to code something special.

Yeah, its being inputted into a structure field that is pulling the categories from another structure field. This is the full code atm:

          socialPlatforms:
            label: Social Media Platforms
            type: structure
            help: This defines the categories you can use for the social media information below
            fields:
              socialPlatform:
                label: Platform Name
                type: text
          socialMedia:
            label: Contact & Social Media Information
            type: structure
            max: 5
            help: Add your social media information here! 
            fields:
              platform:
                label: Platform
                type: select
                required: yes
                options: query
                query: 
                  fetch: site.socialPlatforms.toStructure
                  text: "{{ structureItem.socialPlatform }}"
                  value: "{{ structureItem.socialPlatform.slug }}"
                help: The options for this category are selected from the **Social Media Platforms** table above.
              emailToggle:
                label: Is this an E-mail? 
                type: toggle 
                default: no
                text: 
                  - "No"
                  - "Yes"
                width: 1/2
              link:
                label: Link
                type: url
                required: yes
                width: 1/2
                when: 
                  emailToggle: no
              emailLink:
                label: Email Link
                type: email
                required: yes
                before: 'mailto:'
                width: 1/2
                when: 
                  emailToggle: yes
              displayText:
                label: Display Text
                type: text
                width: 1
                help: Fill this out if you want the text shown on the website to be different than the link.