String.includes failing

uuid: 9cb198d3b8b94e5f8326d3a1aad47446

using a script to pad zeroes on the beginning of an ID. In that I’m using a string.includes to search for a substring. works fine in the browser but fails in the automation.

no idea why here.

edit: log of the error.
https://avt-connect.com/automation-editor?view_history_item=247130&view_history_item_record_uuid=b96114aee21a4e0e8ba927a790e99789&view_history_item_trigger_row_unique_id=&view_history_item_step_uuid=ee917ad9f84249f8885c5fa81fb38759&view_history_item_tenant_uuid=&view_history_item_person_uuid=2f5972e4272b43b380ea5420dba023b7

Javascript that runs on the server in an automation is not equivalent to Javascript that runs in the browser. I’ve never heard of “String.includes”, which means it is probably new and something that the server-side Javascript engine doesn’t support.

ok. do you know what would be the proper call for searching a string for a substring?

I use indexOf(), e.g. “test”.indexOf(“es”)

ok that works. thanks