Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Customer Services Automatic Record Creation

Posted on by 11

Hi,

I have got Automatic Record Creation working to create cases from emails for all known Contacts with the exception of the Contacts in one particular Account - the same Account (company) that I am in.

This previously worked fine when I was in Dev but it does not seem to work in Prod. In summary:

  • emails are received in monitored mailbox ok
  • emails are processed by Dynamics and appear as Activities
  • Cases are created automatically for all but one Account
  • The Power Automate flow cancels after less than a second as "no valid customer found"
  • I have received some error messages which advise "Attribute 'customerid' cannot be NULL" but I cannot find much assistance when searching on that

I do have a Contact record as well as being a Dynamics user and wasn't sure if that would cause this.

Any assistance anyone can advise would be much appreciated!! 

  • Mike Gaffaney Profile Picture
    Mike Gaffaney 11 on at
    RE: Customer Services Automatic Record Creation

    Hi Steve,

    Apologies for the delay.

    Error comes up from any Contact from this particular Account - which is the Account for my company so all Contacts are users.

    Cheers,

    Mike

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customer Services Automatic Record Creation

    Hi,

    The error comes up only when you set Test USER2 as Customer or whichever Contacts/Accounts you set?

  • Mike Gaffaney Profile Picture
    Mike Gaffaney 11 on at
    RE: Customer Services Automatic Record Creation

    Thanks Steve,

    Details are:

    Customer (Accounts) expression: {if(startsWith(variables('Customer from email sender'),'accounts'),variables('Customer from email sender'),string(''))}

    Customer (Contacts) expression:  {if(contains(variables('Customer from email sender'),'contacts'),variables('Customer from email sender'),string(''))}

    How would I go about exporting the Contact data? I've done exports and imports before but I suspect you are meaning something different.

    Cheers,

    Mike

  • Mike Gaffaney Profile Picture
    Mike Gaffaney 11 on at
    RE: Customer Services Automatic Record Creation

    Hi Lorne,

    That would be my Plan B option if all else fails but I think there might be an underlying issue that should be resolved unless this is normal behaviour for Customer Services?

    I've also seen this type of error, where it refers to the "customerid", when I try and convert an email to a Case, it comes up with the following:

    pastedimage1629098692458v1.png

    Cheers,

    Mike

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customer Services Automatic Record Creation

    Hi,

    It is a weird thing. The error message ("Attribute 'customerid' cannot be NULL"") means that your customerid(A required column which display name is Customer) in the case is null. 

    Can you provide the expression of Customer(Accounts) and Customer(Contacts) in the "Create a record" step? You can find them here:

    customer.png

    They should be if(startsWith(variables('Customer from email sender'),'accounts'),variables('Customer from email sender'),string('')) and if(contains(variables('Customer from email sender'),'contacts'),variables('Customer from email sender'),string('')).

    And also please export the Contact data and check whether the value of "_emailsender_value" is contained in it or not.

  • AriaConsulting Profile Picture
    AriaConsulting 2,655 on at
    RE: Customer Services Automatic Record Creation

    Assumably because Flow still knows the GUID is there in the service fabric. What happens if you add a 3rd option to the check sender step Steve showed in his screenshot for "user" in addition to the contacts and accounts options? And obviously to the steps following?

  • Mike Gaffaney Profile Picture
    Mike Gaffaney 11 on at
    RE: Customer Services Automatic Record Creation

    Thanks Steve,

    I changed the email address for the contact and then did a test which then made "_emailsender_type" = contacts  and it got further through the flow so it did not terminate at the point at which it did before. It gets to the next stage where it trys to create a record but then it fails the check with the following: ""message": "Attribute 'customerid' cannot be NULL""

    pastedimage1628866906736v1.png

    It is like it cannot see the Account for some reason.

    Any suggestion on what to try next?

    Cheers,

    Mike

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customer Services Automatic Record Creation

    Hello Mike,

    The "_emailsender_type" value "systemusers" means that your email sender is a User in your CRM, and the value of  "_emailsender_value"  is your user id in your CRM which type is GUID indeed.

    And in the Power Automate flow, there is a step to check the sender's type(As the following screenshots shows). If it isn't accounts or contacts, the flow will fail. This is why your flow failed.

    NoUser.png

     

    I have tested it when the sender of email is a User and a Contact in my CRM, the sender is the User rather than the Contact. So your issue should cause by this. You can change the email of Contact  to test it.

  • Mike Gaffaney Profile Picture
    Mike Gaffaney 11 on at
    RE: Customer Services Automatic Record Creation

    Hi Steve,

    Details below:

    "_emailsender_type": "systemusers",

    _emailsender_value has a value defined - looks like a GUID type format.

    Any thoughts on how I can fix?

    Cheers,

    Mike

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customer Services Automatic Record Creation

    Hi,

    What's your value of '_emailsender_type' property in the body of  Power Automate flow?

    And `_emailsender_value` property has value or not?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans