New hires in Supabase, a PMRF for each
Your HR app keeps its new hires in Supabase. Here's a PhilHealth PMRF for each, from that table.
First, in Supabase. Open the Table Editor, and find the table your HR app writes to. Here it's employee: one row for each new hire.
You need two things from here. Tap Connect, then API Keys, and copy the project's address. Then, in Project Settings, under API Keys, make a secret key and copy it.
Now in PhilForms. Open Workflows, start a new one, and pick the form: the PhilHealth PMRF.
Choose Supabase. Paste your project's address: it ends in supabase.co. Then the table: here, employee.
Paste the secret key you copied. PhilForms only ever reads this one table.
Each column is matched to a field. Check them, and type the purpose once, for every row: registration.
Save and check. Every row passes the form's checks before a PDF is made.
Make the PDFs: one PMRF for each new hire, with the name, birth date and TIN from your table.
To fill each new hire as they're added, make a hook address, and give it to a Supabase Database Webhook, on Insert.
PhilForms reads the row again from your table, so the form always matches Supabase.
The people, the birth dates and the TINs in this video are made up. The Supabase in it is a real Supabase, run on our own machine for the video with a made-up employee table; its project address and key are stand-ins for the ones you would paste. The PMRFs are what PhilForms filled from that table.
What you need from Supabase, what is read (and what never is), the webhook and the errors: the Supabase guide. PhilForms only reads your table: it never writes to your database.
- The project's address: Project Settings ▸ Data API, like https://abcdefghijklmnopqrst.supabase.co. Not the dashboard's address. - A secret key just for PhilForms: Project Settings ▸ API Keys ▸ Secret keys ▸ New secret key (sbsecret…). A publishable (anon) key reads nothing from a table under row-level security, and PhilForms says so instead of showing an empty table. - The table or a view in the public schema, with a plain id column if you want each new row filled the moment it is added. - Only the rows and columns the form needs? Make a view of them and name the view. For a login that may read one table and nothing else, use Company database instead: the guide has the SQL.
1. On Workflows, tap New workflow and pick the form: here, the PhilHealth PMRF. 2. Under Bring your rows, choose Supabase. Type the project's address and the table, paste the secret key, and tap Read the rows. 3. Your columns are matched to the form's fields. Check each one; click a column to change its field, or type one value for every row. 4. Tap Save and check: every row is checked the way the fill will check it, before any PDF or credit. 5. Tap Make the PDFs: one PMRF per row, in one ZIP. 6. To fill each new hire as they are added: under Run it when something happens, tap Make a hook address. In Supabase, Integrations ▸ Database Webhooks ▸ Create a new hook on the same table, event Insert, HTTP Request, POST, with that address.
The webhook sends only which row was added: PhilForms reads that row again from your table with the saved key, so the form always matches Supabase, and a call from anyone else can only fill a row you already have.