Guest User Invitation Automation
When a form is submitted requesting external access, auto-send an Azure AD B2B guest invitation and notify the requester.
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
This flow automates the Azure AD B2B guest user invitation process. When an employee submits a Microsoft Forms request for external guest access, the flow automatically sends a B2B invitation to the guest, confirms the request with the submitter, and notifies an admin — eliminating manual invitation steps and ensuring consistent onboarding.
Use Case
IT Admins and security teams need a standardized, auditable way to grant external users access to the organization. Instead of manually creating guest accounts in Azure AD, employees submit a form with the guest's details and business justification. The flow handles the invitation automatically, creating a paper trail of who was invited, why, and by whom.
Flow Architecture
When a New Response Is Submitted
Microsoft Forms — When a new response is submittedForms webhook trigger fires when a new response is submitted to the 'FlowLibs - Guest Access Request' Microsoft Form.
Get Response Details
Microsoft Forms — Get response detailsRetrieves the full form response (guest email, display name, justification, department).
Initialize Variable - Guest Email
Initialize variableStores the responder's email initially (will be overridden later with the Q1 answer).
Initialize Variable - Guest Display Name
Initialize variableCaptures Q2 answer (guest's display name).
Initialize Variable - Business Justification
Initialize variableCaptures Q3 answer (long-text business justification).
Initialize Variable - Department
Initialize variableCaptures Q4 answer (choice: Engineering, Marketing, Finance, HR, IT, Sales).
Set Guest Email from Q1
Set variableOverrides the guest email variable with the actual Q1 answer (the external guest's email).
Initialize Variable - Redirect URL
Initialize variableLoads the configurable invitation redirect URL from the environment variable.
Initialize Variable - Notification Email
Initialize variableLoads the admin notification email address from the environment variable.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_GuestAccessFormID | String | <configure> | Microsoft Forms encoded ID for the guest request form. Get this from the Forms share URL after deploying the form in your tenant. |
| flowlibs_InvitationRedirectUrl | String | https://myapps.microsoft.com | Where guests land after accepting the invitation. |
| flowlibs_NotificationEmail | String | admin@your-tenant.onmicrosoft.com | Admin email address that receives guest invitation notifications. |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint root URL (shared across FlowLibs solutions). |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Forms | shared_microsoftforms | When a new response is submitted (trigger) Get response details |
| Azure AD Identity and Access | shared_aadinvitationmanager | CreateInvitation (Send B2B guest invitation) |
| Office 365 Outlook | shared_office365 | Send an email (V2) (Confirmation + admin notification emails) |
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.
- Update environment variables
- Set flowlibs_GuestAccessFormID to your own Microsoft Forms ID, flowlibs_InvitationRedirectUrl to your preferred landing page, and flowlibs_NotificationEmail to your admin email.
- Update connections
- Replace the three connection references (Microsoft Forms, Azure AD Identity and Access, Office 365 Outlook) with connections authenticated in your own tenant.
- Create the Microsoft Form
- Recreate the 'FlowLibs - Guest Access Request' form with the same 4 questions (Guest Email, Guest Display Name, Business Justification, Department), or point the env var to your existing guest request form.
- Turn on the flow
- After importing the solution, change the flow state from Stopped to On.
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 response field access
Each form question has a unique field ID; this expression retrieves a specific answer from the Get response details output.
EXPR.02Responder email
Returns the authenticated email of whoever submitted the form.
EXPR.03Customized invitation message
Personalizes the B2B invitation email body with department and business justification context.
EXPR.04HTML email body
Built using concat() with HTML tags for professional formatting in the confirmation and admin notification emails.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.