Checking and validating hundreds of incoming leads every day is a massive headache for sales teams. With leads coming from multiple sources—such as contact forms, inbound emails, and third-party integrations—your Dynamics 365 system can quickly become cluttered with fake emails, test submissions, and outright spam. Reps end up wasting precious hours sifting through garbage data instead of engaging with genuine prospects.
What if you could automatically validate every incoming lead, assess its authenticity, and boost your lead score in real time using native Power Platform tools?
Here is a step-by-step guide on how to build an automated AI-Based Lead Scanner for Dynamics 365 Sales and Marketing using Power Automate and AI Builder Prompts.
The solution relies entirely on native, low-code Power Platform features:
Trigger: A new Lead record is created in Dataverse/Dynamics 365 (via Web, Email, or API integration).
AI Analysis: Power Automate calls a custom AI Builder Prompt, passing four key attributes: Email, Phone Number, Address, and Description.
Structured Validation: AI analyzes the lead data for syntax, disposable domains, and logical consistency (e.g., matching area code formats to physical address locations).
Actionable Output: AI returns a structured JSON payload with individual check results and a confidence score.
Automated Lead Scoring: Dynamics 365 processes the output to auto-update custom lead fields, increment lead scores, or archive spam automatically.
In the Power Apps portal, navigate to AI Hub > Prompts and create a new custom prompt.
Get started with prompt library – Microsoft Copilot Studio | Microsoft Learn

Define four parameters:
EmailAddress
PhoneNumber
Address
Description
Copy and paste the following prompt configuration into AI Builder:
You are an expert sales lead auditor and data validation assistant. Analyze the provided lead information to determine if the lead is genuine or spam.
Lead Details:
Email:
{EmailAddress}Phone:
{PhoneNumber}Address:
{Address}Description:
{Description}Analysis Guidelines:
Check if the email address syntax is valid and whether it looks like a temporary/disposable domain or spam pattern (e.g.,
test12345@asdf.com).Check if the phone number is valid and if its country/area code logically aligns with the provided address location.
Verify if the street address appears to be a real, plausible address structure.
Evaluate the description for coherent buyer intent versus generic spam, gibberish, or promotional links.
Output Requirement:
Respond strictly in valid JSON format using the exact schema below. Do not include markdown code block wrappers (like “`json).
{
“classification”: “Genuine” or “Spam”,
“confidence_score”: 1 to 10,
“reasoning”: “A brief one-sentence explanation of why it was classified this way.”,
“address”: {
“IsValid”: true or false,
“IsGenuine”: true or false,
“reasoning”: “A brief one-sentence explanation regarding the address check.”
},
“EmailAddress”: {
“IsValid”: true or false,
“IsGenuine”: true or false,
“reasoning”: “A brief one-sentence explanation regarding the email check outcome.”
},
“PhoneNumber”: {
“IsValid”: true or false,
“IsGenuine”: true or false,
“reasoning”: “A brief one-sentence explanation regarding phone validation and location alignment.”
}
}
Once your AI Prompt is saved and tested, create an automated cloud flow:
Connector: Microsoft Dataverse
Trigger Name: When a row is added, modified, or deleted
Change type: Added
Table name: Leads
Scope: Organization
Add the Create text with GPT using your prompt action.
Select the prompt created in Step 1.
Map the Lead parameters from the Dataverse trigger:
EmailAddress $\rightarrow$ Primary Email
PhoneNumber $\rightarrow$ Business Phone / Mobile Phone
Address $\rightarrow$ Concatenated fields (Street 1, City, Postal Code, Country)
Description $\rightarrow$ Description
Add a Parse JSON action.
Pass the raw text output from the AI Builder action into the content field.
Provide the JSON schema (matching your prompt structure) so Power Automate can parse individual output attributes.
Add an Update a row Dataverse action target on the Leads table.
Store key returned values in custom Lead attributes:
AI Classification (Genuine / Spam)
AI Confidence Score (1–10)
AI Validation Summary

With structured AI validation metrics written back to the lead record, you can build native Dynamics 365 Lead Scoring Rules or automated routing conditions.
| Data Point & Condition | Score Adjustment |
| Classification = “Genuine” | +20 Points |
| Email IsValid & IsGenuine = True | +10 Points |
| Phone IsValid & IsGenuine = True | +10 Points |
| Address IsValid & IsGenuine = True | +10 Points |
| Confidence Score $\ge$ 8 | +10 Points |
| Classification = “Spam” | -50 Points(Auto-Disqualify) |

Implementing an AI-based lead scanner provides immediate business ROI:
Save Sales Hours: Sales representatives stop chasing bogus contacts and dead phone numbers.
Faster Response Times: High-value, verified leads are prioritized instantly for direct rep engagement.
Protect Domain Reputation: Prevent automated email marketing journeys from triggering against hard-bounce and disposable email traps.
Pure Low-Code: Native Power Platform implementation without managing external API integrations or paying for third-party plug-ins.
Subscribe now to keep reading and get access to the full archive.