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
Sean ClarkSean Clark 

Error: Incorrect parameter type for function 'or()'. Expected Boolean, received Text

I'm building a Formula (Text) field to display documents when certain criteria is hit. The formula is below.

IF( 
Candidate__r.Company_Group_Type_Text__c == 'Potentials', 
IMAGE('/servlet/servlet.FileDownload?file=0151v000003E7qF', ''), 
IF( 
Candidate__r.Company_Group_Type_Text__c == 'Trusted', 
IMAGE('/servlet/servlet.FileDownload?file=0151v000003E7qZ',''), 
IF( 
Candidate__r.Company_Group_Type_Text__c == 'Associate', 
IMAGE('/servlet/servlet.FileDownload?file=0151v000003E7qK', ''), 
IF(
Candidate__r.Company_Group_Type_Text__c == 'Influencer', 
IMAGE('/servlet/servlet.FileDownload?file=0151v000003E7qU', ''),
IF(
Candidate__r.Contact_ID__c  == '0030Y00001JQUHr', 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000DoLm', ''),  
IF(
Source__c == 'Vacancy Lead' &&  Source_Date__c  >= TODAY() - 7 &&  Source_Date__c  <=  TODAY(), 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp1y', ''),  
IF(
Source__c == 'Vacancy Lead' &&  Source_Date__c  >= TODAY() - 14 &&  Source_Date__c  <=  TODAY() - 8, 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp3f', ''),  
IF(
Source__c == 'Vacancy Lead' &&  Source_Date__c  >= TODAY() - 21 &&  Source_Date__c  <=  TODAY() - 15, 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp3G', ''),  
IF(
Source__c == 'Vacancy Lead' &&  Source_Date__c  >= TODAY() - 28 &&  Source_Date__c  <=  TODAY() - 22, 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp3V', ''),  
IF(
Source__c == 'Vacancy Lead' && Source_Date__c >= TODAY() - 7 &&  Source_Date__c  <=  TODAY()&& Candidate__r.Company_Group_Type_Text__c == 'Influencer' || 'Potentials' || 'Trusted' || 'Associate', 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp1y', ''),  
IF(
Source__c == 'Vacancy Lead' && Candidate__r.Company_Group_Type_Text__c == 'Influencer' || 'Potentials' || 'Trusted' || 'Associate' && Source_Date__c  >= TODAY() - 14 &&  Source_Date__c  <=  TODAY() - 8, 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp3f', ''),  
IF(
Source__c == 'Vacancy Lead' && Candidate__r.Company_Group_Type_Text__c == 'Influencer' || 'Potentials' || 'Trusted' || 'Associate' && Source_Date__c  >= TODAY() - 21 &&  Source_Date__c  <=  TODAY() - 15, 
IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp3G', ''),  
IF(
Source__c == 'Vacancy Lead' && Candidate__r.Company_Group_Type_Text__c == 'Influencer' || 'Potentials' || 'Trusted' || 'Associate' && Source_Date__c  >= TODAY() - 28 &&  Source_Date__c  <=  TODAY() - 22, 

IMAGE('/servlet/servlet.FileDownload?file=0151j000000Dp3V', ''),  
NULL 
)))))))))))))

The highlighted section i have recently added and is the issue, it doesn't seem to like the '||' but i need it to say if the source is Vacanacy Lead, if the soruce date is between the specified and if the Company Group Type Text equals Potentials or trusted or influencer or associate.

The only part it isn't liking is the Company Group Type Text equals Potentials or trusted or influencer or associate.
 
Best Answer chosen by Sean Clark
Ramesh DRamesh D
@Sean,
try replacing the line with below code 
&& (Candidate__r.Company_Group_Type_Text__c == 'Influencer' || Candidate__r.Company_Group_Type_Text__c =='Potentials' ||Candidate__r.Company_Group_Type_Text__c == 'Trusted' || Candidate__r.Company_Group_Type_Text__c =='Associate'),

Thanks
Ramesh​​​​​​​

All Answers

Ramesh DRamesh D
@Sean,
try replacing the line with below code 
&& (Candidate__r.Company_Group_Type_Text__c == 'Influencer' || Candidate__r.Company_Group_Type_Text__c =='Potentials' ||Candidate__r.Company_Group_Type_Text__c == 'Trusted' || Candidate__r.Company_Group_Type_Text__c =='Associate'),

Thanks
Ramesh​​​​​​​
This was selected as the best answer
Sean ClarkSean Clark
Hello Ramesh,

This works perfectly! thanks for your help