This is a public Forum  publicRSS

Topic

    Andy Townshend
    Can I Compare Two Fields in Workspace RulesAnswered
    Topic posted September 5, 2018 by Andy TownshendApprentice 
    42 Views, 2 Comments
    Title:
    Can I Compare Two Fields in Workspace Rules
    Content:

    I am attempting to use workspace rules to validate data.

     

    - In one column I have multiple fields of user-entered data, collected at ticket submission
    - In a second column will be the "correct" data that we have collected on our side.

    When I hit a button I would like a rule to compare the user submitted value to our data's value and if they are equal, show an object.

     

    As proof of concept, I can make this work when I hard enter the correct value into the Condition. However, when I attempt to use the fieldname variable (e.g.  $contact.c$new_email) it is not functioning.

     

    Is there a way to compare two fields in a workspace rule in order to trigger an action?

     

    Thanks!

    Version:
    Service Cloud 17D

    Best Answer

    Deepu Kolkkadan

    Hi Andy,

    I believe that we can’t compare two field values inside the workspace rule, below is the workaround for this.

    1. Create a custom field as a flag (Yes/No field)
    2. Place a browser control inside the workspace with a blank page url.
    3. Create a custom script and by using Javascipt API read required field values from workspace.
    4. Compare these two values from the script and based on the result set Yes/No field value in workspace using Javascript API.
    5. Write workspace rule like: When a button click, set the url of browser control (Custom script url)
    6. Write a workspace rule like: When a field changes(Yes/No) and field value equal ‘Yes’ then show an object.

     

    Regards,

    Deepu

    Answer

     

    • Deepu Kolkkadan

      Hi Andy,

      I believe that we can’t compare two field values inside the workspace rule, below is the workaround for this.

      1. Create a custom field as a flag (Yes/No field)
      2. Place a browser control inside the workspace with a blank page url.
      3. Create a custom script and by using Javascipt API read required field values from workspace.
      4. Compare these two values from the script and based on the result set Yes/No field value in workspace using Javascript API.
      5. Write workspace rule like: When a button click, set the url of browser control (Custom script url)
      6. Write a workspace rule like: When a field changes(Yes/No) and field value equal ‘Yes’ then show an object.

       

      Regards,

      Deepu

    • Andy Townshend

      Thanks Deepu

      Though this seems a little elaborate it sounds like it would work.

      We will probably try to work around this issue by importing all the data at ticket submission and have this validation done before it is opened in the agent workspace.