I am trying to find features that have value in a field that has an apostrophe. How does one do this?
Here is what I have, but it won't work because of the apostrophe in Can't:
else if ( $feature["media_type"] == 'Can't Find Curb Tie') {
return "Can't Find Curb Tie"
}
Solved! Go to Solution.
Try changing the single quotes to double quotes around the string you are trying to find
"Can't Find Curb Tie"
You can use "\" to escape individual characters, too, though simply swapping double quotes is probably simpler.
'Can\'t Find Curb Tie'
Try changing the single quotes to double quotes around the string you are trying to find
"Can't Find Curb Tie"
You can use "\" to escape individual characters, too, though simply swapping double quotes is probably simpler.
'Can\'t Find Curb Tie'
I tried to use Arcade's Filter function but it failed to create a proper sql statement with the single apostrophes (working in Hebrew, so this may be an added factor).
So I used the above to create a loop with an if statement to mimic the filter function on my tables. This queries a lookup table and finds a specific value, to grab the corresponding attributes:
var plantname = $feature["L_PlantHebName"] //input value
var tbl = FeatureSetByName($datastore,"PlantLookupTable", ['PlantHebName', 'PlantCode'], false)
var fixed_name = Replace(plantname, "'", "\'")
for (var table_row in tbl){
if(table_row.PlantHebName == fixed_name ){
return table_row.PlantCode
}
}