FlowChart check duplicates

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • alexisc
    replied
    this formula works, thank you very much!!!

    Leave a comment:


  • yuri
    replied
    In condition there should be only one expression. You could use the formula before the gateway in the script task, and then check only variable in the gateway (as variable is an expression too).

    Or try this in gateway:

    Code:
    ifThenElse(
        entity\attribute('phoneNumber'),
        record\exists(
            'Lead',
            'phoneNumber=', entity\attribute('phoneNumber'),
            'id!=', entity\attribute('id')
        ),
        false
    );
    This is a single expression.

    Leave a comment:


  • alexisc
    replied
    does not work

    I want to check using BPM for matches by phone number when creating and launch an additional action based on the result of the check, if anyone has a solution, please share
    Last edited by alexisc; 04-22-2022, 11:03 AM.

    Leave a comment:


  • rabii
    commented on 's reply
    remove the semi-colon and try again.

  • alexisc
    replied
    I try this code on gateway element, it doesn't work, what am I doing wrong?

    Code:
    $phoneNumber = entity\attribute('phoneNumber');
    
    $hasDuplicate =
    ifThenElse(
    $phoneNumber,
    record\exists('Lead', 'phoneNumber=', $phoneNumber),
    false
    );

    Leave a comment:


  • yuri
    replied
    You can utilize formula record\exists function. Assign the result of the function to a variable. Then check the variable value in a gateway element. If the variable is not empty, it means there's a duplicate.

    In a Script Task:

    Code:
    $phoneNumber = entity\attribute('phoneNumber');
    $emailAddress = entity\attribute('emailAddress');
    
    $hasDuplicate =
        ifThenElse(
            $phoneNumber,
            record\exists('Lead', 'phoneNumber=', $phoneNumber),
            false
        ) ||
        ifThenElse(
            $emailAddress,
            record\exists('Lead', 'emailAddress=', $emailAddress),
            false
        );
    Last edited by yuri; 12-25-2021, 10:22 AM.

    Leave a comment:


  • rabii
    replied
    check this out https://docs.espocrm.com/development/duplicate-check/

    Leave a comment:


  • jd13579
    started a topic FlowChart check duplicates

    FlowChart check duplicates

    Hello,

    I am trying to get update a specific lead, and check if there is already duplicate who has the same phone or email, I am still a little bit new to the flowchart formulas.

    How can I check for duplicates by phone or number in the BPM flowchart?

    Many Thanks!
Working...