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

VLOOKUP and TEXT with a Picklist

VLOOKUP(TEXT( $ObjectType.Workflow__c.Fields.Stage_of_Install__c) , TEXT($ObjectType.Workflow__c.Fields.Name) , Workflow__c ) <> TEXT(Stage_of_Install__c)


The above code gives me the error, "Error: Incorrect parameter for function TEXT(). Expected Number, Date, DateTime, Picklist, received Object"


The object, "$ObjectType.Workflow__c.Fields.Stage_of_Install__c" IS a Picklist.


Thanks for your input!




As you have pointed that $ObjectType.Workflow__c.Fields.Stage_of_Install__c" IS a Picklist which in reality is a collection of options whereas text function takes text string as input.

Hence you need to modify your code as follows:-

VLOOKUP(TEXT(if( ISPICKVAL($ObjectType.Workflow__c.Fields.Stage_of_Install__c,"ABC"), "ABC" ,ISPICKVAL($ObjectType.Workflow__c.Fields.Stage_of_Install__c,"XYZ"),"XYZ" ," ")) , TEXT($ObjectType.Workflow__c.Fields.Name) , Workflow__c ) <> TEXT(if(ISPICKVAL($ObjectType.Workflow__c.Fields.Stage_of_Install__c,"ABC"), "ABC",if(ISPICKVAL($ObjectType.Workflow__c.Fields.Stage_of_Install__c,"XYZ"), "XYZ,"  "))


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.