web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Lead lookup in CRM 365

(0) ShareShare
ReportReport
Posted on by 20

Hi Friends ,

I'm working on a project where we have an online form which is filled up by our subscribers to get a communication preference settings. On that form we have 4 fields as below

1) Last name

2) Forename

3) Email ID

4) membership ID

Once the form is submitted it gets created as a lead on our CRM 365. 

I would like to run a process that will trigger an email to the lead on their submitted email ID. That is the working fine, however, I would like to set an extra step to check if the submitted membership ID exists in our CRM database before sending them an email. If exists then send email,  Below are the steps I have created however the process doesn't carry out a lookup in our database. Here Enquire description field is a field in the lead form where the membership ID is stored and the Customer(member/contact) is the field where we have the membership ID of our customers. 

8053.CMR-365_5F00_Lead_5F00_step.jpg

Could you guide me on where I'm doing wrong? and guide me in the right direction, please. 

I have the same question (0)
  • Verified answer
    LuHao Profile Picture
    40,892 on at

    Hi Biswad,

    To achieve it, we have to use power automate(flow).

    In the flow, there is a step "List records" that search all records of the entity and return the search result.

    Go to https://us.flow.microsoft.com/, select the D365 environment, click Solutions, edit a custom solution, new a flow.

    pastedimage1594630960346v1.png

    First set the trigger, search for "When a record is created" and add it. Select "Entity Name" to Leads.

    pastedimage1594632631797v4.png        pastedimage1594632679320v5.png

    Then add a step, search for "list records" and select it.

    pastedimage1594631530896v2.png

    Select "Entity Name" to Leads. In the "Filter Query", enter Enquire description field's name eq 'Enquire description field's dyanmic value'.

    pastedimage1594633350895v6.png

    Then add a condition, set the first value to length(outputs('List_records')?['body/value']), and then select is not equal to, the second value is 0.

    pastedimage1594633487874v8.png       pastedimage1594633566540v9.png

    In the “If yes”, add step "send an email (V2)".

    pastedimage1594633633035v10.png

    Finished. This is an overview of flow.

    pastedimage1594633706869v11.png

    pastedimage1594633747290v12.png

  • Biswad Profile Picture
    20 on at

    Thank you very much Sir, I will give it a go and let you know. Much appriciated your help on this brother..

  • Biswad Profile Picture
    20 on at

    Hi Hao,

    Thank you for looking into my issue. Much appreciated brother, however, I'm getting an error in the list record step.

    Screen1.jpgscreen2.jpgscreen3.jpg

    Any Idea what causing it. I have replicated the exact same steps you have mentioned.  

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Biswad,

    Can you please check the field name in List Records Filter Query?

    You need to use Membership ID Field (use its physical name here), if still doesn't work please share the update screen shot of List Query Action.

    To point you in the direction, Bad Request means web service (retrieve) fails due to faulty filter or configuration of List records action.

    Best,

    Wahaj

  • Biswad Profile Picture
    20 on at

    Thank you for looking into it brother.. I'm still getting the same error after I entered the membership ID field manually .. Here is the screenshot. Any suggestions would be greatly appreciated.

    screeshot5.jpg

  • Wahaj Rashid Profile Picture
    11,321 on at

    Hi Biswad,

    Seems like your Filter Query is wrong.

    It should be like <physical field name> eq '<mebersip id value>'.

    See following screenshot of yours:

    8037.screeshot5.jpg

    If you are not sure about field name, open form, open Membership ID field properties and on the Details tab look for Name field.

  • LuHao Profile Picture
    40,892 on at

    Hi Biswad,

    First please don't use D365 connector in the power automate, but use Common Data Service connector, because D365 connector is deprecated.

    https://docs.microsoft.com/en-us/power-platform/important-changes-coming#dynamics-365-connector-is-deprecated

    Could you provide a screenshot of the Enquire description field properties? like this.

    pastedimage1594778709201v1.png

    We will use its name (not display name) in the Filter Query, so the Filter Query should be Enquire description field's name eq 'Enquire description field's dyanmic value'.

    new_enquiredescription is the name of the field in my environment, just for demonstration. Please use the name of the field in your environment.

  • Biswad Profile Picture
    20 on at

    Hi brother, 

    Here are the screenshots. I have a question as when we use the dynamic "Enquire description" field does it lookup to the membership ID we have in the database? if so how will it identify on which field its going to check.

    screenshot7.jpgScreenshot6.jpg

    Thank you for your effort in solving this problem .. Much appreciated. 

  • LuHao Profile Picture
    40,892 on at

    Hi Biswad,

    1. First, we need to confirm that the value of the "Enquire description" field is the membership ID. 

    2. "List Records" is the equivalent of record Query, which queries an entity for all records that satisfy the Filter according to the condition "Filter Query".

    Please refer to carldesouza.com/.../

    So once it searches for a record that has the same "Enquire description" field value as the new created Lead, it adds the record to an array as an element. When all the Lead records are searched, an array containing all Leads records which repeat "Enquire description" field values will be returned.

    Therefore, we only need to determine whether the number of elements in the returned array is not 0. If it is not 0, it means that the Lead which haa the same "Enquire description" field value is found. If it is 0, then the "Enquire description" field of the new created Lead record is unique.

    You can test the flow after you create it.

  • Biswad Profile Picture
    20 on at

    Hi Hao ,

    Thank you for taking your time to look into this. For some reason I'm unable to common data model connector, later I figured out that the our CRM is with the CRM service provider. I have taken this issue with them and they said the have a inbuilt plugin which will server the work flow I'm trying to achieve.  Also the form in the front end need to be redesign. I truly appreciate your answer and I will get back to this forum when  I will have issue.

    Stay blessed brother..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 168 Super User 2026 Season 1

#2
NeerajPawar Profile Picture

NeerajPawar 65

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans