SharePoint Workflow: Dynamic Task Assignment
First in a series on solving common SharePoint Designer workflow problems: How to dynamically assign tasks based on user-entered data. Uses InfoPath forms, SharePoint lists as data sources, and workflow variables.
The Problem
A typical scenario: Your organization has 50 managers. A form has a field identifying the expense area. The approval task must be assigned to that area's manager—determined dynamically from user input.
Requirements
- • Users complete InfoPath forms with area selection
- • Tasks route to correct manager based on selected area
- • No developer intervention needed for adding new managers
- • Use only out-of-box SharePoint Designer features
Solution Overview
Step 1: Create Data Source
Create a SharePoint list named _Areas with these fields:
- • Name (String) - Area name
- • Email (String) - Manager email
- • Account (Person/Group) - Manager AD account
Populate with all 50 managers.
Step 2: Connect InfoPath Form
In InfoPath:
- 1. Tools → Data Connections → Add
- 2. Select SharePoint list as source
- 3. Choose the _Areas list
- 4. Bind dropdown field to this data connection
Users can now select from managers dynamically.
Step 3: Create Workflow Variable
In SharePoint Designer workflow:
- 1. Create action: Set Workflow Variable
- 2. Create variable
PreApproveUser(String) - 3. Set value using lookup function
Step 4: Lookup Logic
Configure lookup like SQL:
SELECT AD_User FROM _Areas
WHERE _Areas.Manager = Procurement.Manager
This retrieves the AD account based on user's area selection.
Step 5: Assign Task
Create action: Collect Data from User
- • Assign to variable
PreApproveUser - • Store response in workflow variable
- • Continue workflow based on response
Key Concepts
- Workflow Variables: Store dynamic values for use throughout workflow
- Data Source Lookups: Query SharePoint lists like database tables
- InfoPath Integration: Form data drives workflow routing decisions
- Non-Developer Maintenance: Business users can update manager list
Modern Context: Workflow Evolution
SharePoint Designer workflows are deprecated. Modern alternatives:
- • Power Automate: Visual workflow builder with extensive connectors
- • Logic Apps: Azure-based enterprise workflow orchestration
- • Power Apps: Forms with built-in approval flows
- • Microsoft 365 Approvals: Pre-built approval templates
Key Takeaways
1. Dynamic routing based on data - essential for flexible workflows
2. Lookup patterns remain relevant - same concepts apply in Power Automate
3. Variables enable complex logic - store and reuse data throughout process
4. Modern tools are more powerful - but core workflow patterns persist