<aside> 👉 Links (Property base class)

ButtonProperty

CheckboxProperty

CreatedByProperty

CreatedTimeProperty

DateProperty

EmailProperty

FilesProperty

FormulaProperty

MultiSelectProperty

LastEditedByProperty

LastEditedTimeProperty

NumberProperty

PeopleProperty

PhoneNumberProperty

Property

RelationProperty

RichTextProperty

RollupProperty

SelectProperty

StatusProperty

TitleProperty

UniqueIdProperty

UrlProperty

VerificationProperty

Notion Ruby Mapping Public API Reference

</aside>

1. Instance methods

Filter usage

These methods return a Query; .filter in the examples reads its generated Hash. Creating a condition does not send an API request or update the property value. [DB/DS] indicates query usage, not an execution-time restriction on the method.

For equals and does_not_equal, pass a status option name as a String. Omit condition: and another_type: for an ordinary status filter; these optional keywords are for nested Formula / Rollup conditions. StatusProperty includes EqualsDoesNotEqual and IsEmptyIsNotEmpty, not ContainsDoesNotContain.

[DB/DS] filter_does_not_equal(value) → Query

Creates a Query object whose status condition does not match the given option name.

ds.properties["StatusTitle"].filter_does_not_equal("In progress").filter
# => {"property" => "StatusTitle", "status" => {"does_not_equal" => "In progress"}}

[DB/DS] filter_equals(value) → Query

Creates a Query object whose status condition matches the given option name.

ds.properties["StatusTitle"].filter_equals("In progress").filter
# => {"property" => "StatusTitle", "status" => {"equals" => "In progress"}}

[DB/DS] filter_is_empty → Query

Creates a Query object whose status condition matches properties with no status option.

ds.properties["StatusTitle"].filter_is_empty.filter
# => {"property" => "StatusTitle", "status" => {"is_empty" => true}}

[DB/DS] filter_is_not_empty → Query

Creates a Query object whose status condition matches properties with a status option.

ds.properties["StatusTitle"].filter_is_not_empty.filter
# => {"property" => "StatusTitle", "status" => {"is_not_empty" => true}}

status → Hash

  1. [P] status of Page property returns the status property value of the page.

  2. [DB/DS] status of Database / DataSource property returns the raw status schema body, including options and groups when they are included in the retrieved API response.

    page.properties["StatusTitle"].status
    # => {"id"=>"F<XA", "name"=>"Design", "color"=>"purple"}
    
    ds.properties["StatusTitle"].status
    # =>
    # {"options"=>
    #  [{"id"=>"dfd8a326-f149-4b01-b01a-57d8aed6de1b",
    #    "name"=>"Not started",
    #    "color"=>"default"},
    #   {"id"=>"f17767fd-3186-4ba2-8d3a-01eef36e88ec",
    #    "name"=>"In progress",
    #    "color"=>"blue"},
    #   {"id"=>"F<XA", "name"=>"Design", "color"=>"purple"},
    #   {"id"=>"IRXI", "name"=>"Implementation", "color"=>"orange"},
    #   {"id"=>"ceb89388-7f74-4bd5-a52d-0fd572a409f6",
    #    "name"=>"Done",
    #    "color"=>"green"}],
    #  "groups"=>
    #  [{"id"=>"2b356467-0400-420c-ad91-cdd5f98fc799",
    #    "name"=>"To-do",
    #    "color"=>"gray",
    #    "option_ids"=>["dfd8a326-f149-4b01-b01a-57d8aed6de1b"]},
    #   {"id"=>"ff88fa16-34b6-4818-ae5c-f8ce892d888b",
    #    "name"=>"In progress",
    #    "color"=>"blue",
    #    "option_ids"=>["IRXI", "f17767fd-3186-4ba2-8d3a-01eef36e88ec", "F<XA"]},
    #   {"id"=>"de6040ae-17d1-4dc7-939c-b7db49bcf482",
    #    "name"=>"Complete",
    #    "color"=>"green",
    #    "option_ids"=>["ceb89388-7f74-4bd5-a52d-0fd572a409f6"]}]}