I'm using the AirTable API with Powershell, to lookup records in AirTable where a column value contains a special character ('#')
For example, I'm trying to filter on AirTable rows for a Color column that contains a '#'.
Let's say the Color value is 'ABC#1'.
I have tried different combinations of double quotes and back-slashes, but nothing seems to work:
Using the original color definition doesn't work....it generates an invalid formula error.
But no matter what I do in the 2nd variable, I continue to get an invalid formula error.
$OriginalColor = 'ABC#1'
$LookupColor = $Color.Replace('#', '\#')
$filter = "?filterByFormula=And({Division}='$Division',{Style}='$Style',{Color}='$LookupColor')"
The error I get is:
iwr : {"error":{"type":"INVALID_FILTER_BY_FORMULA","message":
"The formula for filtering records is invalid: Invalid formula. Please check your formula text."
Maybe it's something more specific I need to do with double quotes, but everything I've tried has generated the same error.
Any thoughts?
Thanks,
Kevin