Unified Service Desk condition comparison issue RRS feed

  • Question

  • Hi,

    I am using Unified Service Desk. The task was, when clicking on contact from other entities, show existing contact tab if this contact already opened or create new session if contact is different from already opened. Thanks to this article I found how to get URL of clicked contact in place type. But using conditions on window navigation rules or actions, can not correctly compare contactid from clicked contact and in context contact.Id. In case with condition on action call ( which is hanged on window navigation rule), script below always gives me true and if I change == to != it also gives true (tried === and !== as well). Action Call is a DisplayMessage with this properties:


    var targetId =$Expression(/%257b([a-z0-9\-]+)\%257d/i.exec('[[URL]]')[1]);
    var existingId = "[[contact.Id]]";
    targetId == existingId


    text=$Expression(/%257b([a-z0-9\-]+)\%257d/i.exec('[[URL]]')[1]) + [[contact.Id]]

    Result message box:

    5EE7F26E-1976-E711-8100-5065F38B74A1 + 5CE7F26E-1976-E711-8100-5065F38B74A1

    And once more, if I change condition to targetId != existingId message still appears if Ids are equal:

    5EE7F26E-1976-E711-8100-5065F38B74A1 + 5EE7F26E-1976-E711-8100-5065F38B74A1

    So looks like condition works incorrectly. Maybe someone have met such behavior and resolved it somehow, I am really stuck in it.

    Thank you.

    p.s. Tried using includes() and other types of similar functions instead of regular expression with the same result.

    Saturday, October 14, 2017 12:11 PM