Form Submission to SQL Logger
When a Microsoft Form is submitted, insert the response as a new row in a SQL table. Demonstrates the basic Insert Row action with a real trigger. Great starter flow for SQL Server demos.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
FlowLibs - Form Submission to SQL Logger is a beginner-level Power Automate cloud flow that demonstrates the most common SQL Server integration pattern: capturing form submissions and logging them directly to a SQL database. When a Microsoft Form is submitted, the flow retrieves the response details and inserts a new row into a SQL Server table with the submitter's email, submission date, and response ID.
This is the first SQL Server connector flow in the FlowLibs library and serves as the foundational pattern for all SQL Server demos.
Use Case
Organizations often need to capture structured data from end users (feedback, requests, registrations) and route it into a central SQL database for reporting, analysis, or downstream processing. This flow eliminates manual data entry by automatically writing each form submission to SQL in real time.
Common scenarios: customer feedback logging, event registration tracking, IT support request intake, employee survey data capture, and any form-to-database pipeline.
The flow is ideal for teams that:
- Customer feedback logging
- Event registration tracking
- IT support request intake
- Employee survey data capture
- Any form-to-database pipeline
Flow Architecture
When a New Response Is Submitted
Forms WebhookFires when a new response is submitted to the configured Microsoft Form.
Get Response Details
Forms ConnectorRetrieves the full response data (submitter email, submit date, answers) using the response ID from the trigger.
Init varSqlServer
Initialize VariableLoads the SQL Server hostname from the flowlibs_SqlServerName environment variable. Runs in parallel with the other Init actions.
Init varSqlDatabase
Initialize VariableLoads the SQL database name from the flowlibs_SqlDatabaseName environment variable. Runs in parallel with the other Init actions.
Init varSqlTable
Initialize VariableLoads the SQL table name from the flowlibs_SqlTableName environment variable. Runs in parallel with the other Init actions.
Insert Form Response Into SQL
SQL Server ConnectorInserts a new row using PostItem_V2 with server, database, and table from variables, mapping form response fields (submitter email, submit date, response ID) to SQL columns. Runs after all four parallel actions above complete.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_FormSubmissionFormId | String | <configure> | The ID of the Microsoft Form. Find it in the Form URL after id=. |
| flowlibs_SqlServerName | String | your-server.database.windows.net | The SQL Server hostname (for example an Azure SQL fully-qualified name). |
| flowlibs_SqlDatabaseName | String | FlowLibsDemoDB | The SQL database containing the target table. |
| flowlibs_SqlTableName | String | [dbo].[FormSubmissions] | The fully qualified SQL table name (schema and table, bracketed). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Forms | shared_microsoftforms | When a new response is submitted (trigger) Get response details |
| SQL Server | shared_sql | PostItem_V2 (Insert row) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Create the SQL table
- Create a table in your SQL database with columns matching the form fields. Example: CREATE TABLE [dbo].[FormSubmissions] ( Id INT IDENTITY(1,1) PRIMARY KEY, SubmitterEmail NVARCHAR(255), SubmittedDate DATETIME2, ResponseId NVARCHAR(50) );
- Create the Microsoft Form
- Create a form in Microsoft Forms with your desired questions (e.g. Name, Email, Feedback). Copy the Form ID from the URL after id= and use it for the flowlibs_FormSubmissionFormId environment variable.
- Configure environment variables
- Update the four environment variable current values in the solution: flowlibs_FormSubmissionFormId (your Form ID), flowlibs_SqlServerName (your SQL Server hostname), flowlibs_SqlDatabaseName (your database name), and flowlibs_SqlTableName (your table name, e.g. [dbo].[FormSubmissions]).
- Update the SQL column mapping
- Open the Insert Form Response Into SQL action in the designer. The default mapping sends SubmitterEmail, SubmittedDate, and ResponseId. To add form question fields, click into the action's item/row parameters, add new fields matching your SQL column names, and map each to the corresponding form response field using dynamic content from Get Response Details (answers are keyed by question ID, e.g. body/rXXXXXXXXXX).
- Authorize connections
- Update both connection references (Microsoft Forms and SQL Server) with authorized connections for your tenant.
- Turn the flow on
- Toggle the flow from Off to On. Submit a test form response to verify a new row appears in your SQL table.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Form ID environment variable reference
Used by the trigger and Get Response Details to reference the Form ID env var.
EXPR.02Response ID from trigger payload
Extracts the response ID from the Forms webhook trigger payload for Get Response Details.
EXPR.03Submitter email from response
Submitter's email address — mapped into the SubmitterEmail SQL column.
EXPR.04Submission timestamp
Submission timestamp — mapped into the SubmittedDate SQL column.
EXPR.05SQL Server name variable
SQL Server name from the env var, used in the Insert Row action's server parameter.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.