I have a Zap that has been functioning smoothly for over a year. However, in the past few weeks, it has started throwing an error on this line:
// error: TypeError: value.toLowerCase is not a function
value.toLowerCase()
Does anyone know if there have been changes on Zapier’s infrastructure that could lead to this issue? Maybe a nodeJS version update or something similar?
I believe that the input to this function hasn’t changed. Is there an easy method to log the value of value for verification?
I encountered this problem some time ago as well. In my case, the input to the function was unexpectedly receiving a different data type rather than a string, which caused the toLowerCase() method to fail. It’s crucial to ensure that the variable value is indeed a string before calling the method on it. You might want to implement a check like if (typeof value === 'string') { value.toLowerCase() }. Additionally, logging the type and value using console.log(typeof value, value) right before that line can help you pinpoint the issue. This kind of discrepancy is often caused by changes in the API responses or input data structures.
sounds like zapier’s sending null or undefined values now. try String(value).toLowerCase() or value?.toLowerCase?.() if your environment supports it. I’ve been hitting the same issue since their recent updates.
I just ran into this same thing! Adding a fallback check fixed it for me. Zapier changed how they handle empty values, so now you need (value || '').toLowerCase() - this way if value is null or undefined, it defaults to an empty string and won’t throw an error. You could also try value && value.toLowerCase ? value.toLowerCase() : '' to double-check that toLowerCase exists before using it. Works with Zapier’s new input handling.