function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mathewsmathews 

TEXT function

 

Is it possible to use     the function "TEXT"  for a pick list field .

 

TEXT(targetXtestPac__type__c)  ?

 

Is there any work around ?

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

It's your lucky day, I'm having a 2 for 1 Sale on Answers...

 

Here you go: 

 

Create a Formula(Text) field that returns the Text value selected from your Picklist Field using the formula 

TEXT(PicklistFieldName)

 then you can use the CONTAINS function on your Formula(Text) field

 

CONTAINS(Formula_Text__c, "Online")

 

 

All Answers

Steve :-/Steve :-/

In what context are you trying to do this?  A Validation Rule, Formula Field, WFR?

mathewsmathews

in WFR

Steve :-/Steve :-/

Can you post the complete WFR formula/desired result?  TEXT(Picklist) doesn't really evaluate or resolve to anything.  There needs to be some sort of context like :  IF(TEXT(Picklist) = "ABC", TRUE, FALSE)

mathewsmathews

 IF(TEXT(Type__c)  contains  "%online%", TRUE, FALSE)

 

Type__c is a pick list field

Steve :-/Steve :-/

Not "Directly" via a straight formula but it can be done a couple of different ways.

mathewsmathews

Can you tell me how to do ?

 

 

Steve :-/Steve :-/

If you just need to evaluate a Picklist on the Object that you're triggering your WFR from you can use the Rule Criteria Wizard (rather than the Formula Wizard) and select the Picklist field and use the CONTAINS operator and then enter the text in the Value box.  

 

If you need to go across objects or use the Formula Wizard then it gets a bit trickier (but it still can be done)  

 

Which one do you need?

mathewsmathews

I prefer the second option

 

 

Formula Wizard

Steve :-/Steve :-/

It's your lucky day, I'm having a 2 for 1 Sale on Answers...

 

Here you go: 

 

Create a Formula(Text) field that returns the Text value selected from your Picklist Field using the formula 

TEXT(PicklistFieldName)

 then you can use the CONTAINS function on your Formula(Text) field

 

CONTAINS(Formula_Text__c, "Online")

 

 

This was selected as the best answer
mathewsmathews

Thanks Stevemo

Steve :-/Steve :-/

No problem, you owe me a beer (terms non-negotiable)

 

PS.  I like to drink these -> http://beeradvocate.com/beer/profile/863/7971