Toggle Field Doesn't Display Default Value

Hi,

The following toggle field should default to true (“Yes”), but on adding a new page, false (“No”) is selected.

display_cover_image:
        label: Display Cover Image?
        type: toggle
        default: "Yes" 
        text:
          - "No" # negative value must come first
          - "Yes"
        width: 1/4

Is there something wrong with the above YAML?

Cheers,

Stefan

Try setting the default with true or false, not with your custom text.

In your case:

display_cover_image:
        label: Display Cover Image?
        type: toggle
        default: true
        text:
          - "No" # negative value must come first
          - "Yes"
        width: 1/4
1 Like

Your solution is indeed working! I guess I got confused by the word value in the description:

default: Default value which will be saved when a new page/user/file is created

I thought this value referred to the text value.