I have a row level formula in a report where I want to use an IF statement, I got it working with a few example conditions, e.g.
IF(Case.Sales_District_Lookup__c = "123456", "ABC-123",
IF(Case.Sales_District_Lookup__c = "123478", "ABC-456", "Other"))
Problem is that I have 785 conditions to check for, each one roles up into a bucket e.g. ABC-123. I built out the IF statements but I got an error message about byte length not exceeding 4000chars.
I know that there is a way to nest the values along the lines of IF(contains(Case.Sales_District_Lookup__c="123456:123478:123490" "123456"), "ABC-456", "Other")
but I cannot get this to work - I get syntax errors.
Can anyone help me with how to nest my values to reduce the byte length?
Hello @Jayne Anderson
your post is nearly 2 years old, but as you are working with a lookup (considering the name of your field) I would create a dedicated field on the sales district record with the literal value you expect to get in your formula, and would go up through the relationship to this dedicated field.
With so many values, and single value buckets, you will not be able to shrink the size of your formula.
You can still use a record triggered flow or apex code, on record insertion/update to update it with the proper value, based on a mapping with a custom metadata type or configuration object, but that is not a very clean solution, as you want to map an id value, and that is still pretty sensitive, especially with deployment operations.
Eric