assign account after converting - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Charlie SmithCharlie Smith 

assign account after converting

I'm setting up a process builder that reassigns an Account to specific users once it's created, but I'm not able to get this formula to work.
IF(VALUE([Account].Round_Robin__c,'1', 'USERID1'),
IF(VALUE([Account].Round_Robin__c,'2', 'USERID1'),
IF(VALUE([Account].Round_Robin__c,'3', 'USERID1'),
IF(VALUE([Account].Round_Robin__c,'4', 'USERID1'),
IF(VALUE([Account].Round_Robin__c,'5', 'USERID1'),
NULL)
))))

 
Best Answer chosen by Charlie Smith
Amnon KruviAmnon Kruvi
If we go with your formatting, it should look like:
IF([Account].Round_Robin__c = 1, 'USERID1'),
IF([Account].Round_Robin__c = 2, 'USERID1'),
IF([Account].Round_Robin__c = 3, 'USERID1'),
IF([Account].Round_Robin__c = 4, 'USERID1'),
IF([Account].Round_Robin__c = 5, 'USERID1'),
NULL)
))))

The VALUE() function converts text to numbers, so if the field is already numeric then you don't need it. Also, to compare two values we use the = sign. 

Another syntax you can use is CASE:
CASE([Account].Round_Robin__c, 
1, "user ID", 
2, "user ID", 
3, "user ID",
4, "user ID", 
"user ID") 

 

All Answers

Amnon KruviAmnon Kruvi
Hi Charlie, 

What kind of field is Rround Robin: picklist, text, or number? 
Charlie SmithCharlie Smith
Hi Amnon, this is a formula field that spits out a number 
Amnon KruviAmnon Kruvi
If we go with your formatting, it should look like:
IF([Account].Round_Robin__c = 1, 'USERID1'),
IF([Account].Round_Robin__c = 2, 'USERID1'),
IF([Account].Round_Robin__c = 3, 'USERID1'),
IF([Account].Round_Robin__c = 4, 'USERID1'),
IF([Account].Round_Robin__c = 5, 'USERID1'),
NULL)
))))

The VALUE() function converts text to numbers, so if the field is already numeric then you don't need it. Also, to compare two values we use the = sign. 

Another syntax you can use is CASE:
CASE([Account].Round_Robin__c, 
1, "user ID", 
2, "user ID", 
3, "user ID",
4, "user ID", 
"user ID") 

 
This was selected as the best answer
Charlie SmithCharlie Smith
I was able to save it using that CASE syntax, however when I try to convert a lead to an Account I'm not seeing the owner reassigned after.
Amnon KruviAmnon Kruvi
Then the problem is likely elsewhere in your process. How did you build it? 
Charlie SmithCharlie Smith
I have the process check if the account is a specific record type, and if it is assigned to a specific user. If both are true, then I need the process to reassign the owner ID based on the Round Robin fieldUser-added image
Amnon KruviAmnon Kruvi
From the screenshot, it looks like both values in the criteria are empty. Is this correct?
Also, and this sounds like a very silly question, but did you make sure to activate the process?
Charlie SmithCharlie Smith
Oh the values are there, just covered them - but yes it is activated!
 
Amnon KruviAmnon Kruvi
OK, so we're going to need to debug this :) 
​​​​​​
One way we can do this is to add another action to the same criteria, right after setting the owner. This can be an email action, or creating a new task for yourself - anything that we can see afterwards. This will let us know whether the criteria returns true and the actions are executed (which means the problem is in the update step) or not (which means the problem could be the criteria or process itself). 
Charlie SmithCharlie Smith
Got it to work! Forgot that when using the User ID, I just need to grab the 15 digits when in lightning. Thanks for the help!