Skip to content

Daily

Get yesterday's new Dynamics 365 leads by email

Each morning you see every lead created the day before, with its owner and source, in one email.

Runs
Daily
Apps
Dynamics 365
AI
Not needed
Access
read (security role with lead read)

Send this to your assistant

Create a ClickRuntime automation: every weekday at 8am, email me the leads created in Dynamics 365 yesterday with name, company, owner and lead source.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A sales manager using Dynamics 365 wants to know who came in yesterday: new leads from the website, a trade show list or a partner referral. But the leads view needs filtering by created date, and most people never set that up, so they scroll through a long list or look at a dashboard that is cached and unclear. Leads that arrive overnight sit untouched until someone happens to look, and lead response time is one of the strongest predictors of whether a lead converts.

Each morning the automation queries Dynamics 365 for leads whose created date falls on the previous day, formats them into a readable list with name, company and source, and emails it. Your team starts the day with a ready list of people to contact.

Sales managers, inside sales reps and marketing teams that hand leads over will benefit most.

What you get out of it

  • Faster first contact with every lead

    Leads contacted within a day convert far better than ones left a week. A morning list means each new lead is assigned and called while the person's interest is still fresh.

  • Nothing lost over the weekend

    Monday's email covers the leads that arrived while the team was away, so no one waits until Tuesday for a reply. Weekends are where a lot of quiet lead loss happens, because nobody is looking and the enquirer is already talking to a competitor.

  • Managers see volume and sources

    The list shows how many leads came in and from where. A sudden drop in yesterday's numbers is an early sign that a web form, an ad campaign or an integration has broken, and you can fix it before a week of leads is lost.

  • Fair assignment of leads

    With the whole list in view, a manager can hand out leads evenly or by territory. Nobody cherry-picks from a live view, and nothing is left unassigned over a busy Monday, which keeps the team feeling the split is fair.

  • No need to build a saved view

    The filter on created date is built in, so nobody has to maintain a view in Dynamics. It works the same way for everyone and does not break when someone edits a view.

How it works

What happens, step by step

  1. Every morning, ClickRuntime looks up the leads created in Dynamics 365 the day before.

  2. For each lead it notes the name, company, owner and source.

  3. You get one email with a line per lead, like "Priya Shah (Northwind Traders) | owner Sales Team | source Web".

Before it runs live

  • Connect Dynamics 365

What you get

RunsDaily
Get yesterday's new Dynamics 365 leads by emailtoday, 9:00Succeeded
Email · New leads yesterdayPriya Shah (Northwind Traders) | owner Sales Team | source Web

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Run it at a different time, more or less often, or only on weekdays
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Dynamics 365 steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
daily_new_leads_digest_dynamics_365.pyexample
from datetime import date, timedelta
from clickruntime import on_trigger, credentials, http, notify

ORG = "https://acme.crm.dynamics.com"
FMT = "@OData.Community.Display.V1.FormattedValue"

@on_trigger
def run(event):
    yesterday, today = date.today() - timedelta(days=1), date.today()
    resp = http.get(f"{ORG}/api/data/v9.2/leads", params={
        "$select": "fullname,companyname,leadsourcecode,_ownerid_value",
        "$filter": f"createdon ge {yesterday}T00:00:00Z and createdon lt {today}T00:00:00Z",
        "$orderby": "createdon asc"},
        headers={"Authorization": f"Bearer {credentials.connection('dynamics-365', 'work')}",
                 "Accept": "application/json", "Prefer": 'odata.include-annotations="*"'})
    resp.raise_for_status()
    leads = resp.json()["value"]
    lines = [f"{l['fullname']} ({l.get('companyname') or '-'}) | owner {l.get('_ownerid_value' + FMT, '-')} "
             f"| source {l.get('leadsourcecode' + FMT, '-')}" for l in leads]
    notify.email_me(f"{len(leads)} new leads yesterday", "\n".join(lines) or "No new leads.")
    return {"leads": len(leads)}

FAQ

Common questions

Which leads are included?
Leads whose created date falls within the previous day are included, with fields such as name, company, source and contact details. The email is a snapshot, so a lead edited later will not change a list already sent. You can add or remove fields, or restrict it to a particular owner, region or status.
Does it need special permissions in Dynamics 365?
The account used needs read access to the lead table through the Dynamics web API, so ask your Dynamics administrator which service account to use. A security role with read privilege on leads is enough, and the credentials are stored as secrets.
Can I get it only on weekdays?
Yes. The schedule can skip weekends, and Monday's run can cover Friday, Saturday and Sunday together. Tell your AI assistant how far back each run should look and it will set the date range accordingly.
What permissions does it need?
read (security role with lead read). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (daily). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get yesterday's new Dynamics 365 leads by email” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.