<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Case insensitive, partial match on string field using feature effect. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1658492#M87729</link>
    <description>&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;I want to perform a feature effect query that is both case insensitivity and partial.&amp;nbsp; If the name field has "HELLO" in it, I want to it match any variation of HELLO, hello, he, etc...&lt;/P&gt;&lt;P&gt;The best I can get is doing:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;name LIKE '%HELLO%'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Which will find all occurrences, and combinations of HELLO, (HE, HEL, etc...), but when I try to add case insensitivity it doesn't work.&lt;/P&gt;&lt;P&gt;How do you make that case-insensitive?&amp;nbsp; I have to do this using a feature effect query because the layer data I'm looking at, is from a StreamLayer, so I have to query the LayerView,&lt;/P&gt;&lt;P&gt;I thought doing this might have worked&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;(name LIKE UPPER('%hel%'))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But I get an error about UPPER, so now I think the best way to tackle this issue is by asking the Stream for a feature update.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 16 Oct 2025 16:03:16 GMT</pubDate>
    <dc:creator>AndrewMurdoch1</dc:creator>
    <dc:date>2025-10-16T16:03:16Z</dc:date>
    <item>
      <title>Case insensitive, partial match on string field using feature effect.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1658492#M87729</link>
      <description>&lt;P&gt;Good Day&lt;/P&gt;&lt;P&gt;I want to perform a feature effect query that is both case insensitivity and partial.&amp;nbsp; If the name field has "HELLO" in it, I want to it match any variation of HELLO, hello, he, etc...&lt;/P&gt;&lt;P&gt;The best I can get is doing:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;name LIKE '%HELLO%'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Which will find all occurrences, and combinations of HELLO, (HE, HEL, etc...), but when I try to add case insensitivity it doesn't work.&lt;/P&gt;&lt;P&gt;How do you make that case-insensitive?&amp;nbsp; I have to do this using a feature effect query because the layer data I'm looking at, is from a StreamLayer, so I have to query the LayerView,&lt;/P&gt;&lt;P&gt;I thought doing this might have worked&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;(name LIKE UPPER('%hel%'))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But I get an error about UPPER, so now I think the best way to tackle this issue is by asking the Stream for a feature update.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 16:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1658492#M87729</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2025-10-16T16:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Case insensitive, partial match on string field using feature effect.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1658531#M87731</link>
      <description>&lt;P data-unlink="true"&gt;It appears the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-FeatureFilter.html#where" target="_self"&gt;where clause&lt;/A&gt; is parsed and applied client-side, and if it doesn't&amp;nbsp;support functions like UPPER and LOWER, then it doesn't appear the SDK can natively do what you want.&lt;/P&gt;&lt;P&gt;However, it is possible to apply this kind of filtering by adding your own functionality to add conditions for every combination.&amp;nbsp; It's not pretty but it works, although I'm not sure what performance would be like as search values get longer and longer, since there would 2-to-the-power-of-x conditions where x is the number of characters in the input string.&lt;/P&gt;&lt;P&gt;The following set of functions gets the job done:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function addWordCombinations(word, index, partial, wordCombinations) {
	if (index &amp;lt; word.length) {
		addWordCombinations(word, index + 1, partial + word[index].toUpperCase(), wordCombinations);
		addWordCombinations(word, index + 1, partial + word[index].toLowerCase(), wordCombinations);
	} else
		wordCombinations.push(partial);
}

function getWordCombinations(word) {
	var wordCombinations = [];

	if ((typeof word == "string") &amp;amp;&amp;amp; (word.length !== 0))
		addWordCombinations(word, 0, "", wordCombinations);

	return wordCombinations;
}

function getCaseInsensitiveQueryConditions(fieldName, userValue) {
	var wordCombinations = getWordCombinations(userValue);

	if (wordCombinations.length === 0)
		return "1=0"; //query with this where clause would return no records
	else
		return "(" + fieldName + " LIKE '%" + wordCombinations.join("%' OR " + fieldName + " LIKE '%") + "%')";
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With those in place, and assuming the user-specified search value was stored in a variable called "userValue" and the attribute field name was "name", you'd have something like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;featureFilter.where = getCaseInsensitiveQueryConditions("name", userValue);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: this implementation assumes the user-specified search value doesn't contain apostrophes (i.e. single quotes).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, looking back after already typing up everything above, I notice you say you tried:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(name LIKE UPPER('%hel%'))&lt;/LI-CODE&gt;&lt;P&gt;but have you tried:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(LOWER(name) LIKE '%hel%')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If that works it would be so much simpler...&lt;/P&gt;</description>
      <pubDate>Thu, 16 Oct 2025 18:13:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1658531#M87731</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2025-10-16T18:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Case insensitive, partial match on string field using feature effect.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1660482#M87779</link>
      <description>&lt;P&gt;Good Morning&lt;BR /&gt;&lt;BR /&gt;Please excuse the delay in response, I thought I responded last week.&lt;BR /&gt;&lt;BR /&gt;That is what I thought, the added complexity of doing this is not worth the headache, and it just creates more ways in which my filter can break.&amp;nbsp; I was believing that the queries supported SQL92 syntax, which does not appear to be the case, and I can't remember where I read that.&lt;/P&gt;&lt;P&gt;I think the best course of action is to have our backend introduce querying, and since I'm using the Stream Layer, they can just send me updated information.&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 14:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/case-insensitive-partial-match-on-string-field/m-p/1660482#M87779</guid>
      <dc:creator>AndrewMurdoch1</dc:creator>
      <dc:date>2025-10-24T14:14:50Z</dc:date>
    </item>
  </channel>
</rss>

