The gist
Takes an incoming title (from Zapier, a webhook, etc.) and strips out every character that isn't a letter, number, or space. The result is a "drive-safe" string that won't throw errors when used as a filename in SharePoint, Google Drive, or any system that chokes on punctuation, emojis, or special characters.
The flow
- Input —
inputData.title(e.g. an article or deal name pulled from another step). - Sanitize. A single regex replaces everything that is not
a-z,A-Z,0-9, or a space with an empty string. - Trim. Removes leading/trailing whitespace left after stripping.
- Return —
cleaned_titleas a single discrete field, ready to map straight into a "Create File" or "Create Folder" action.
Why this exists
SharePoint (and several other document systems) will reject or error on filenames containing certain special characters, emojis, or odd unicode. Instead of debugging cryptic API errors after the fact, this one-liner cleans the name upstream so the downstream file creation always succeeds.