Questions tagged [contains]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
45 views

Warning Error when encoding row-level formula: Syntax error. Missing '='

I don't know what is wrong in the formula bellow:
luisa anjos's user avatar
0 votes
1 answer
196 views

CONTAINS() function ignores special characters

As part of Flow logic, I have a decision element that is checking if the subject line for an email-to-case contains the string "[Critical]" or "[Urgent]", including the square ...
eHarazi's user avatar
  • 133
0 votes
1 answer
59 views

Nested IF CONTAINS AND Formula - results not returning correct answers - What am i doing wrong?

I am looking to return the values to an Expected Revenue column, based on the WEB FORM CAMPAIGN field having specific words in. The campaign names are set up like the following, so I am looking for ...
Rob Boyton's user avatar
0 votes
0 answers
218 views

Flow CONTAINS on Case Subject not matching

I have a before trigger flow that runs on CREATE that has a decision node to check if the case subject contains the phrase "intake session canceled". I am using a case formula that trims and ...
Matthew Metros's user avatar
0 votes
0 answers
160 views

Search for Specific Text in a Multi-Select

I have a multi-select that lists bandwidths. Some are in Mbps, and some are in Gbps. I need to know if any of the selected options is over 1 Gbps, so I'd like to search the multi-select for the text '...
Jerry Woods's user avatar
0 votes
1 answer
2k views

How can I add a "contains" criteria in a SOQL query?

I am running a simple query that takes First name, Last name, and email from a dataset. At the end of my query, I need to include to only pull the email addresses that contain ".com" I ...
Pbres's user avatar
  • 1
-1 votes
1 answer
1k views

Contains or Regex in formula for checking multiple values

I'm writing a formula to check of a field (for example, "Country"), contains one of many values. Example: CONTAINS(“Massadonia Republic:Dominican Republic:US:UK”,Country) From what I'm told ...
user1702965's user avatar
1 vote
1 answer
120 views

Why .contains only returns true if it is an exact match in the app, but works fine in developer console?

In the developer console this works fine: String op1 = '12345'; String op2 = '1234'; Boolean tmpResult = true; system.debug('op1: '+op1+', op2: ' +op2+', tmpResult: ' +tmpResult ); tmpResult = op1....
ApexCowboy's user avatar
1 vote
1 answer
291 views

Get element from list which contains element from another list

I have two Lists with diffeerent lenghts and want to check this value. It must be something list that: List<String> first = new List<String>{'Test','Something'}; List<String> second =...
Terdivi's user avatar
  • 51
-2 votes
1 answer
89 views

CONTAINS("HP:H-P:NA.Co",Company) function returns true even if Company name is "-","NA" and "."

I need advice in writing Contains function while using the Formula field. CONTAINS("HP:H-P:NA.Co", Company) function should return true only if it matches the exact substring H-P or NA.Co ...
Siddharth Parnam's user avatar
1 vote
1 answer
52 views

Search List for variable for comparison using contains

I am trying to find the Name variable in a list to use the contains() method to search for the Name of the Activity_Assignment__c but am getting an error: Method does not exist or incorrect signature: ...
ForrestFairway's user avatar
-2 votes
1 answer
4k views

How to avoid Case Sensitive Contains check in formula field

I have one formula field where I have used condition IF(CONTAINS(Title, "Chief Architect"),"Architect") So whenever I enter title Chief Architect the formula field appear as ...
abhi saxena's user avatar
2 votes
3 answers
5k views

If Contains "Text" Return "Number"

I'm trying to create formula field which returns 1 when text field CONTAINS certain text, else 0. E.g. if text field "City" CONTAINS NY or New York or NewYork, then it should return 1 else 0....
NikM's user avatar
  • 23
0 votes
1 answer
37 views

Why this set does not contain my data?

I have this data: Account.Zone__c = 'A'; Zone_set = '{ B, A, C}'; if(!Zone_set.contains(Account.Zone__c)) { //do this } Account.Zone__c = 'B'; Zone_set = '{ B, A, C}'; if(!Zone_set.contains(Account....
CPS's user avatar
  • 345
1 vote
1 answer
3k views

How to evaluate multiple values in the Contains function via a declarative salesforce formula

I am trying check if the suppliedemail field contains any of these domains but is not working. If(CONTAINS("lincare.com:ndc-inc.com:preferredhomecare.com", SuppliedEmail), mod(...
sfdev09's user avatar
  • 31
0 votes
1 answer
1k views

Validation Rule CONTAINS

Use Case: When a NEW Opportunity of a particular RecortType is created, AND the OpportunityOwner Country = 'United States' AND the OpportunityOwner Role has the word 'Sales Manager' THROW AN ERROR IF ...
GroundToCloud's user avatar
0 votes
1 answer
58 views

question about .Contains()

I have a quick question in regards to using .Contains(). I'm writing an if statement and need to update a text field if it contains "VA". However, if it contains "IVA" it shouldn't ...
verycold's user avatar
1 vote
1 answer
41 views

IF AND OR together in one formula

I want to write a formula for the following: Return Value A IF: Intake__c.Personal_Care__c contains 'toileting/bathing' OR Intake__c.Safety__c contains 'entering or exiting' AND Intake__c....
Alexis Frisch's user avatar
0 votes
1 answer
273 views

How to check multiple occurrences in the child records?

I have a custom object called "Revence__c" with fields "profit1__c" and "profit2__c". Another custom object called "Product__c" is the parent of "...
MAUForSalesforce's user avatar
0 votes
1 answer
1k views

VisualForce - If Contains Or

I want to be able to render a form section if a picklist contains a certain value (value a) OR if it contains another value (value b). How do I write this correctly? Here is my currently working code ...
Alexis Frisch's user avatar
0 votes
0 answers
21 views

VisualForce - If(CONTAINS) assistance in user form [duplicate]

I'm working with 'Contains' in VisualForce and have a user-fillable form. I want the user to be able to select an option from a picklist and then populate another pageblock section based on if the ...
Alexis Frisch's user avatar
0 votes
1 answer
7k views

How to Blank Date value in Date formula field?

This field is to display the "date" value when this Opportunity's Stage value contains "Closed ". and at the same time Opportunity's Stage value not contains Closed means this ...
Sfdcprgmr's user avatar
  • 405
0 votes
3 answers
653 views

How to find all records where a textfield contains "04/06/2020" twice? [duplicate]

this is a bit of an odd one. Say I need to find all Accounts where the textarea field "Notes__c" contains the text 04/06/2020 twice, how would I go about that? Ideally using Apex or Reports. ...
Nic's user avatar
  • 3
1 vote
0 answers
401 views

Flow condition using CONTAINS doesn't work properly

I'm working on a flow, and basically I'm trying to compare number values with an "Array". when I debug d the flow, the condition fails: DECISION: verificarMesAProbar Skipped this outcome because its ...
Jeferson Ruiz's user avatar
0 votes
2 answers
1k views

Checking if sequence of CHAR are in String

I am struggling with the below example. So basically I want to see if a contact is the Chief Operations Officer. Many of these individuals have the title "COO". So I am running into the following ...
Matthew Metros's user avatar
1 vote
1 answer
26 views

How do I remove repeating parts?

I'm trying to remove a substring with \n + random dateTime value + created date time.. My code works, but I want to make it prettier. How do I remove repeating parts by different conditions? If it's ...
Apelsinova's user avatar
0 votes
1 answer
155 views

'Attempt to de-reference a null object' with Field__c.contains()

When I use contains, I get Attempt to de-reference a null object: for(Gear__c g : gears{ if(toolsMap.get(g.Id).Status__c == 'Off' || toolsMap.get(g.Id).HelpText__c.contains('Hello there!')){ ...
MichaelLev19's user avatar
1 vote
1 answer
60 views

For loop conditional statement for if a List<Contact> contains an element

I have some code like this. While the conditionals I have are working fine what I cannot check for is if Contact lCon is NOT contained in the sfdcList. I have been trying to find a way to set up a Set ...
Randy B.'s user avatar
  • 139
0 votes
1 answer
31 views

IF(CONTAINS) question from an MPL

I am trying to aggregate data from an MPL into a separate field with fewer values. When I run the formulas, it is only returning the first value. Is there a way to rewrite the formula so that all true ...
Mindy99's user avatar
7 votes
5 answers
10k views

Is Apex Sometimes Case Sensitive?

I have a string set of field names populated as below: Set<String> setAllCustomSettingFields = new Set<String>(); Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); ...
Gabriel Rivera's user avatar
-3 votes
1 answer
714 views

Set contains (Field name from Map<String, Schema.SObjectField> fieldMap) not working

I have a below code to check the field name inside the set to field name inside the map. Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.Test__JobApp__c.fields.getMap(); set&...
JURY's user avatar
  • 183
6 votes
3 answers
32k views

How to check if a string contains an element from a list

What is the best way to check if a string contains an element from a list? for example: String email= '[email protected]' List<String> domainNames = split by ; from domains in a custom setting ...
Salvation's user avatar
  • 1,177
1 vote
1 answer
2k views

Set.contains() not working

My set contains custom JSON elements. When i try to use set.contains() method to check if the set has the JSON element it fails. MY JSON DATA: public uJSON(Id id,String name, Boolean manager,Id ...
New's user avatar
  • 39
1 vote
1 answer
132 views

does apex class api version impacts new features

If my apex class API version is 28, will there be any issue if i try to use List class contains method ? I checked in debug logs, even if class has api version 28, i am able to use List contains ...
Walker's user avatar
  • 2,323
2 votes
3 answers
7k views

CONTAINS() Formula

I have a checkbox formula that evaluates true if: Contains(Text_field__c, Account__r.lookup__r.Name) If i have "test account" in the account__r.lookup__r.Name, and "test account" in the ...
J.koh's user avatar
  • 189
-2 votes
2 answers
28k views

How to use CONTAINS in SOQl Query

My SOQL Query string str = '%'+email.subject.trim()+'%'; GMC__c gmcList = [select id,name,Case_Number__c from GMC__c where name like :str limit 1]; GMC__c Name is an autonumber field which ...
Eagerin Sf's user avatar
  • 1,085
1 vote
1 answer
1k views

list.contains in salesforce not working with wrapper class

My wrapper class is as follow: public class FilterWrapper implements Comparable { public String label {get; set;} public String value {get; set;} public Integer compareTo(...
Kritik's user avatar
  • 266
3 votes
1 answer
99 views

Database.Batchable List Record Id

I can't get this for loop to work: global void execute(Database.BatchableContext bc, List<Account> accounts){ List<Account> acctsToUpdate = new List<Account>(); List<...
Chance's user avatar
  • 1,060
0 votes
2 answers
2k views

Method does not exist or incorrect signature?

I want to know if an Opportunity ID of a List is on another List and I get this error: Method does not exist or incorrect signature: [List<FAST_Opp__c>].contains(Id) public FAST__c ...
Jeremy Deseez's user avatar
0 votes
1 answer
114 views

Use Contains to compare a field value

I'm trying to use Contains to judge an email Subject for an Email Service I set up. Currently, I'm using == , but I want to use Contains because the subject might have characters after the text I'm ...
Zoom_v's user avatar
  • 3,860
0 votes
1 answer
70 views

How can I have two strings within an IF(CONTAINS( function?

If the text field contains both "A" and "B", then it should result in "AB". My formula: if(contains( Text_Field__c, "A" & "B" ), "AB", It goes through; there are no syntax errors. But it ...
user avatar
4 votes
1 answer
4k views

How to make use of formula function like "Contains" as case insensitive

I am Comparing a list of two strings in visualforce page using "Contains" function.But currently it retrieves only the exact match.Say,If the Name is Burlington it compares the name which contains "...
Priyalakshmi's user avatar
  • 1,456
2 votes
2 answers
10k views

soql contains on multiple values

I have accounts with billingcities. I have a query like below, select id , billingcity from account where billingcity like%atl% If i want to search on multiple cities, how can I do this? will comma ...
Anurag's user avatar
  • 2,216
2 votes
1 answer
4k views

Use CONTAINS in Visualforce Page Map

I have an apex:pageblocktable in VF Page with 2 columns. The 2nd column is displayed from a map. <apex:pageBlockTable value="{!noZips}" var="Zip"> <apex:column value="{!Zip.ZipCode}" ...
sfdcFanBoy's user avatar
  • 4,054