'TEXT()'. Expected Number, Date, DateTime, Picklist, received Lookup(User)

I'm trying to create a field on the Case object that references a user lookup field on the Account object. Using this:

Account.Customer_Success_Rep__c 

Returns the correct user, but shows the Salesforce ID and I'd like the name. My problem is that this:

TEXT(Account.Customer_Success_Rep__c) 
Gives me this error:
Error: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Lookup(User) 
Why isn't this working? How can I get the text of the field? asked Jul 11, 2017 at 16:54 131 1 1 gold badge 3 3 silver badges 14 14 bronze badges

2 Answers 2

You'd want to use the relationship instead:

Account.Customer_Success_Rep__r.FirstName & " " & Account.Customer_Success_Rep__r.LastName 

TEXT is specifically for converting numbers, dates, and the like to strings so you can manipulate them, not for converting ID values to a label of some sort.

A field where you can select a user with the magnifying glass is not a "picklist", it is a "lookup" field.

answered Jul 11, 2017 at 16:58 500k 21 21 gold badges 467 467 silver badges 818 818 bronze badges Concatenating first name with first name? Commented Jul 11, 2017 at 17:04 @AdrianLarson lol, It's been a long, long morning. Commented Jul 11, 2017 at 17:05

Customer_Success_Rep__c field is a lookup field, you should be accessing some other field in that lookup. Try making your formula Account.Customer_Success_Rep__r.FirstName (or other field if FirstName is not what you want).

If you access the Customer_Success_Rep__c it returns the ID of the lookup object, but accessing as Customer_Success_Rep__r (with r), you get access to its fields.

You can also use the "Insert Field" helper when defining the formula instead of typing it.

answered Jul 11, 2017 at 16:59 Mauricio Oliveira Mauricio Oliveira 555 3 3 silver badges 12 12 bronze badges

You must log in to answer this question.

Related

Hot Network Questions

Subscribe to RSS

Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2024 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2024.9.9.14969