Check if record exists before creating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hrdy90
    Junior Member
    • Apr 2021
    • 28

    Check if record exists before creating

    I am trying to create a contact when email-to-case is happening, but had no luck there. Instead I opted to create a contact when email is received which works great.

    But I am not able to find a way to check if the contact already exists.

    I am using:
    Target entity: Email
    Create Record » Contact

    Email
    Field: From Email Address.lower

    Name
    Field: From Name

    Links
    Emails

    And i tried to make an expression, but it broke the workflow:
    !record\exists(Contact, contactEmail, emailAddress)​
  • rabii
    Active Community Member
    • Jun 2016
    • 1250

    #2
    you can check if an email exit in your workflow trigger using the same expression, like below:
    Code:
    record\exists('Contact', 'emailAddress=', emailAddress);
    However i think you could use bpmn so this way when you identify the new contact ad duplicate you could delete it from your system. also you should be able to create a flowchart that triggers once an email is created and its parentType == Case.

    Hope this helps
    Rabii
    Web Dev

    Comment

    • hrdy90
      Junior Member
      • Apr 2021
      • 28

      #3
      Thank you rabii that worked wonders. Have not checked out the BPM module yet, but will make sure to do so. Seems like a powerful tool!

      Comment

      Working...