0

Excuse my lack of experience on formula's....I am trying to create a formula in a flow variable to assign a queue name to a lead based on what RBU (regional business unit) value is for that lead. I have it working if I just put in a static hardcoded string in that variable, but I would like to make that variable "smarter" to look for the RBU and use the hardcoded queue id based on the RBU value. Here is what I have so far, but I cannot seem to get it working properly:

AND(            
        OR (
ISPICKVAL(RBU__c), "Asia Pacific", '<id for queue to assign to>'), 
ISPICKVAL(RBU__c), "Canada", '<id for queue to assign to>'), 
ISPICKVAL(RBU__c), "Europe", '<id for queue to assign to>'),
ISPICKVAL(RBU__c), "Central America", '<id for queue to assign to>'),
ISPICKVAL(RBU__c), "South America", '<id for queue to assign to>'),
ISPICKVAL(RBU__c), "United States", '<id for queue to assign to>'),
ISPICKVAL(RBU__c), "Middle East", '<id for queue to assign to>'), 
ISPICKVAL(RBU__c), "",'<id for queue to assign to>'))

Any help would be greatly appreciated.

Thanks.

1
  • Hardcoding ids is not a good idea. At least use developer name of the queue and query id for the queue in the flow. Nov 1, 2021 at 17:19

1 Answer 1

1

Currently, your formula doesn't check next values. So Why you're not using case for this things as like below,

Case (TEXT(RBU__c),

"Asia Pacific", '<id for queue to assign to>',
"Canada", '<id for queue to assign to>',
"Europe", '<id for queue to assign to>',
"Central America", '<id for queue to assign to>',
"South America", '<id for queue to assign to>',
"United States", '<id for queue to assign to>',
"Middle East", '<id for queue to assign to>',
'<id for queue to assign to>' //Default
)

Please let me know if it helps.

5
  • MohanRaj, I am getting the following error: NewVariable (Formula) - The formula expression is invalid: Field RBU__c does not exist. Check spelling. However, that field does exist in the Lead object.
    – PowerUp
    Nov 1, 2021 at 17:49
  • Field name "Regional_Business_Unit_Global" is wrong. Please check whether it's custom field means, it's should be ended with "__c".
    – Raj
    Nov 1, 2021 at 17:52
  • I did, it's RBU__c but same error.
    – PowerUp
    Nov 1, 2021 at 17:55
  • Then please check, whether the RBU__c field is in same object which you used in flow. Otherwise, it's need to indicate with parent like "X__r.RBU__c".
    – Raj
    Nov 1, 2021 at 18:05
  • Yeah, I tried Lead__r.RBU__c and same error. This is odd, it's as if it doesn't see the field at all even when using it's API name.
    – PowerUp
    Nov 1, 2021 at 18:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .