Back to Discover

#formulas

1 prompt found

Notion Formula 2.0 Builder: Database Formulas with lets, ifs, Relation Lists, filter and map, Date Math with dateBetween, Progress Bars, and Styled Status Badges
⚡ Productivity

Notion Formula 2.0 Builder: Database Formulas with lets, ifs, Relation Lists, filter and map, Date Math with dateBetween, Progress Bars, and Styled Status Badges

Ppromptstudio·Oct 6, 2026
No rating

Write working Notion Formula 2.0 code for a real database: read relation properties as lists, filter and map them instead of building extra rollups, do date math for overdue and due soon logic, build text progress bars and colored status badges with style, and get a test plan for empty and edge cases.

Act as a Notion workspace consultant who writes Formula 2.0 code for client databases every week, and who knows the syntax changes from the old formula language: relations return lists of pages, current refers to the item inside map and filter, and lets keeps long formulas readable. Inputs: - The database name and every property with its exact name and type (checkbox, number, date, status, select, relation, rollup, person): [DatabaseSchema] - Related databases and the properties on them the formula needs: [RelatedDatabases] - What each formula should show, in plain words: [FormulaGoals] - How the result should look (plain number, text, colored badge, emoji bar): [DisplayStyle] - Edge cases to handle (no related items, empty dates, status values that change): [EdgeCases] - Output format: [Format] Generate: 1. A property map: every property the formulas touch, its type, and how it reads in Formula 2.0 (prop("Name") returns a list of pages for a relation, a text value for status and select, a date for date). 2. One formula per item in FormulaGoals, written with lets for intermediate values and ifs for multi branch logic, indented across lines as the Notion editor allows. 3. Relation logic written directly on the list: prop("Tasks").filter(current.prop("Done")).length() style chains, map to pull a number and sum, so the user can delete helper rollups where it makes sense. 4. Date math with today(), dateBetween in the correct argument order (the result is the first date minus the second), and dateAdd, with an explanation of the sign of each result. 5. Display: progress bars with repeat and round, and badges with style(text, "b", color) using Notion's color names, or plain text if DisplayStyle asks for it. 6. Guard clauses for EdgeCases: empty(), division by zero, missing dates, and status names typed exactly as in the schema. 7. A test plan: three or four sample rows with expected outputs to check in the database before rolling the formula out. Constraints: - Use only property names from DatabaseSchema and RelatedDatabases; ask about any name that is missing. - Write Formula 2.0 syntax only, and note any function the user should confirm in the formula editor's built in reference. - Formulas must not depend on other formulas that create a circular reference. No em dashes.