SharePoint Document Issues

Fix SharePoint Search Cannot Find Documents by Leading Numbers

Natalie TaylorNatalie Taylor Nov 2, 2026 868 views

Question details

Users are unable to reliably locate documents in SharePoint search using document names that start with long numeric identifiers or leading zeros.

Fix SharePoint Search Not Finding Documents by Leading Numbers
Product
SharePoint
Device & OS
not provided
Scenario
Searching for specific documents in a SharePoint document library using the numeric prefixes or long numeric IDs contained in the file names.
Observed behavior
SharePoint search returns unreliable results or completely fails to find the target documents when the search query relies on leading zeros or long numeric portions of the file name.
Before you start

Ensure you have Site Owner or List Administrator permissions in SharePoint to create new columns, and confirm you have an active Power Automate license to create flows for the site.

Solution 1Recommended

Create Metadata Columns and Populate via Power Automate

Bypass file name search limitations by extracting the numeric identifiers into searchable single-line text columns using a Power Automate flow.

SharePoint's default search tokenizer can struggle with long numbers or leading zeros within file names, treating them in ways that cause search failures. By extracting these specific identifiers into dedicated text columns, the search index can reliably locate the files based on exact metadata matches.

1
Create single-line text columns

Navigate to your SharePoint library, click 'Add column', select 'Text', and create columns to store the complete file name and the extracted numeric identifiers.

2
Analyze identifier formats

Review your document library to identify variations in numeric identifiers. Note if the identifiers have different lengths (e.g., 11, 12, or 13 digits) or varying leading zeros, so you can handle them appropriately.

3
Build a Power Automate flow

Open Power Automate and create an automated cloud flow that triggers when a file is created or modified. Use 'Compose' actions to process the file name.

4
Apply substring expressions

Add dynamic expressions like substring(outputs('Compose'),12,8) to extract the exact numeric portion based on the identifier's format. If lengths vary, add condition blocks to handle different formatting rules.

5
Update file properties

Add the 'Update file properties' action to SharePoint. Map the outputs of your substring expressions to the newly created single-line text columns.

6
Wait for indexing and search

Allow time for the SharePoint search crawler to index the newly populated columns. Once complete, search using the metadata columns instead of relying on the file name.

Create Metadata Columns and Populate via Power Automate
Search Index Crawl Time: SharePoint Online search indexing is not instantaneous. It may take between 15 minutes to a few hours for newly populated metadata properties to appear in your search results.
Free Microsoft Office alternative

View and Edit Your Office Documents with WPS Office

While you manage file metadata and search configurations in SharePoint, consider WPS Office as a lightweight, free alternative for viewing and editing your downloaded Word, Excel, and PDF files without heavy subscription fees.

Fully compatible with Microsoft Office formats (.docx, .xlsx, .pptx) exported from SharePoint.Lightweight and incredibly fast to launch, ensuring quick access to large documents.Built-in powerful PDF toolkit for reading, editing, and converting files.Free to use with a familiar, easy-to-navigate interface that requires no learning curve.
microsoft office alternative - wps office

Frequently Asked Questions

Why does SharePoint struggle to search file names with leading zeros?

SharePoint's search engine tokenizes text differently based on delimiters and characters. It often strips or misinterprets leading zeros and very long numeric strings, which leads to incomplete or missing search results when users query exact numbers.

Can I run the Power Automate flow on documents already existing in the library?

Yes, you can create a manual trigger or a scheduled flow to iterate through existing files in the library using the 'Get files' action. Be cautious to accommodate all identifier variations so numbers are not truncated during the update.

What if my file names have identifiers of different lengths?

You should incorporate conditional logic (Condition or Switch actions) in your Power Automate flow to check the length or specific text patterns of the file name before applying the substring expression. This ensures accurate extraction whether the number is 11, 12, or 13 digits long.

How long does it take for the new metadata columns to become searchable?

SharePoint Online performs continuous crawls, meaning new metadata is typically indexed and searchable within 15 minutes to an hour. However, it can occasionally take longer depending on server load and the size of your document library.