AppSheet + Zenphi: Why File Searches Sometimes Fail & How to Fix It

When integrating AppSheet with Zenphi, especially when you're searching for a file by its name (using actions like List Files/Folders), you might run into a frustrating issue:
The file exists in Google Drive, but Zenphi can’t find it.

Let’s break down why this happens—and how to fix it.


🤔 What's Going On?

Here’s a common scenario:

  1. A user enters a name in AppSheet, like:
    👉 Hero's Records

  2. AppSheet creates a file (e.g., a PDF) using that input.
    However, AppSheet sanitizes the filename, which means:

    • Special characters (like apostrophes ') are removed or replaced (e.g., with - or _)

    • So the saved file might become:
      👉 Hero-s Records.pdf
      or Hero_s_Records.pdf

  3. The webhook sends the original input, not the sanitized filename:
    👉 "Hero's Records"

  4. Zenphi receives this and searches for the file using that exact name, but the name no longer matches what’s in Drive.
    Result? ❌ File not found.


✅ How to Fix It

Here are several ways to solve this and ensure Zenphi finds the file reliably:


1. Use the Sanitized File Path or Name

Instead of sending the raw input (e.g., <<[RecordName]>>), configure your AppSheet webhook to send the actual file path from a File-type column, such as [GeneratedFile].

Then in Zenphi:

  • Extract the filename from the path

  • Use that for your Google Drive search

🟢 One of the most reliable and cleanest solutions.


2. Restrict Special Characters in AppSheet Input

To prevent the issue entirely, configure your AppSheet form fields to disallow special characters (like ') in file name inputs.

By doing this, you avoid creating a mismatch between the input and the saved file name.

🟢 Simple and proactive fix.


3. Store the Actual Saved Filename in a Separate Column

If possible, store the sanitized name (e.g., Hero-s Records.pdf) into a separate text column in AppSheet after file creation.
You can then use this sanitized name in your webhook payload.

🟡 Requires extra logic, but keeps things accurate.


4. Use the File ID (The Most Reliable Method)

Yes, this is more complex to implement in AppSheet—but it's the standard, most robust method to identify a file.

By passing the Google Drive File ID to Zenphi:

  • You bypass name issues entirely

  • Zenphi can directly access the file, regardless of special characters or sanitization

🟢 File IDs are unique and guaranteed to work.


5. As a Last Resort: Use “Replace Text” in Zenphi Before Searching

If none of the above options are possible, you can add a “Replace Text” action in Zenphi just before the search, to transform problematic characters.

For example:

  • Replace - with '

This may help match a name like Hero-s Records with the original Hero's Records.

⚠️ However, this is a workaround, not a best practice. Use it only as a fallback, since it’s not always reliable and can feel unprofessional.


📝 Small but Important Note

If Zenphi can’t find the file, it’s not always because of the filename. Another common reason is the search settings in the "List Files/Folders" action—specifically the corpora setting.

To search across all Shared Drives and My Drive, make sure you're using:
👉 corpora = allDrives

🔗 Here’s a quick guide on how “corpora” works and how to set it correctly


💬 Final Thoughts

This filename mismatch between AppSheet input and the saved file name is a subtle but common issue when integrating with Zenphi. Understanding AppSheet’s sanitization behavior—and adjusting how you pass or search for filenames—can save a lot of debugging time.

If you’ve experienced this or have a better workaround, feel free to share your insights with the community!