Skip to main content
edited tags
Link
David Cheng
  • 7.4k
  • 18
  • 55
  • 90
Source Link
Luke Sharon
  • 131
  • 3
  • 13

How to get the value of Custom field with SOQL

I am using SOQL to get team names from salesforce for each current project. It all returns, however the name is returned in ID format rather than the string name. This is confusing to me because when I examine the field in salesforce, the value IS a string. I have been unsuccessful at figuring out how to convert the ID in the string value for display purposes. Here is my SOQL statement:

Select Name, TeamName__c from Project__c where isCurrent__c = true

Like I said, when I examine the actual field in salesforce, the name of the team is a real value. I can't figure out why it is displaying in my query as an ID. There must be some simple solution about how to force the display to imitate that of its value as it appears in salesforce...I sure would appreciate any suggestions. Below is a picture of my current output...you will notice the long random ID. That is where there should be a string with the actual name of the team.

enter image description here