Back to PostHog in Google Sheets
SheetXAI logo
PostHog logo
PostHog · Google Sheets Guide

Bulk Create PostHog Feature Flags From a Google Sheet Definition

2026-05-15
5 min read

The Scenario

The production PostHog project is live. The staging project is empty. A DevOps engineer inherited a definition spreadsheet with 25 feature flags — key, name, rollout percentage, filter group JSON, and active status — that need to exist in the new project before the sprint ends Thursday. The previous workflow was to paste each flag into the PostHog UI one at a time. With 25 flags and filter conditions that need to be entered exactly, doing this by hand is asking for a typo that breaks a rollout in production.

The bad version:

  • Open PostHog's "Create feature flag" form, paste the first flag key, enter the name, set the rollout slider, expand the filter group section, manually re-enter the JSON conditions, save, repeat
  • Hit flag 9 and realize the filter group format in the UI is different from what's in the spreadsheet, spend 30 minutes figuring out which fields map to what
  • Finish all 25 flags, test one in staging, discover that flag 17 has a typo in the filter property name that the UI accepted without warning

Twenty-five flags, each with a filter group, entered by hand through a form is a recipe for drift between the definition doc and what's actually running.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Google Sheet. It reads your flag definition table and calls PostHog's create endpoint for each row — handling the payload construction for you — and writes each returned flag ID back into the sheet.

Create a PostHog feature flag for each row in the 'Flags' sheet — key in column A, name in column B, rollout percentage in column C — and write each returned flag ID back into column D.

What You Get

  • PostHog creates each flag using the exact key, name, and rollout from your sheet
  • Returned flag IDs are written into column D — you have a record linking each definition row to its live PostHog ID
  • Any row that fails (duplicate key, invalid rollout value) gets an error note in column D instead

What If the Data Is Not Quite Ready

Rollout column has inconsistent formatting

Before creating flags, normalize column C: convert any percentage values entered as decimals (e.g. 0.5) to whole numbers (50), then create a PostHog feature flag for each row using key column A, name column B, normalized rollout column C. Write flag IDs into column D.

You want to skip flags that already exist

Before creating each flag, check if a PostHog feature flag with the same key already exists. Skip rows where the key is already present and write "Already exists" in column D. For new keys, create the flag and write the returned ID into column D.

Active status varies by row

Create a PostHog feature flag for each row in the 'Feature Flags' sheet — key in column A, name in column B, rollout in column C, active status from column D (TRUE/FALSE). Write returned flag IDs into column E. Leave column E blank and write the error for any row that fails.

Full validation and bulk creation in one pass

In the 'Flag Definitions' sheet: skip any row where column A (key) is blank or contains spaces, normalize column C rollout values from decimal to whole number if less than 1, then create a PostHog feature flag for each remaining row using key column A, name column B, rollout column C. Write the returned flag ID into column D and "Error: [reason]" for any failures. Write a final count of created vs. failed at the bottom.

Validation and creation together — one prompt, one pass.

Try It

Get the 7-day free trial of SheetXAI and open the spreadsheet where your flag definitions live, then ask it to create the flags in PostHog. Also see: Export All PostHog Feature Flags Into a Google Sheet for Audit and the PostHog hub.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more