Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 798 Bytes

set_icon_to_all_icon_unsettled_pages.md

File metadata and controls

30 lines (22 loc) · 798 Bytes

Set icon to all icon unsettled pages

The following code sets a "💿" icon on all unset pages in the database.

require "notion_ruby_mapping"

include NotionRubyMapping

token = ENV["NOTION_API_TOKEN"]
database_id = ENV["DATABASE_ID"]

NotionCache.instance.create_client token

db = Database.new id: database_id
db.query_database.each do |page|
  unless page.icon
    page.set_icon(emoji: "💿")
    page.save
    p page.id
  end
end
Before execution After execution
Before execution After execution

Return to README.md