Forum Discussion
Issues with Report Name Conversion When Uploading Reports Using PostImportFile REST API
- 7 months ago
This is expected behavior (unfortunately) and comes from Power BI Service sanitizing the import “name”.
1) Double quotes
The import name is treated like a filename/title and Power BI strips/normalizes invalid characters. A plain " can cause the service to fail the “rename” step internally, and it falls back to a default name (what you’re seeing as “No File Model”).
Fix: don’t send quotes. Replace with safe characters, e.g.:Sales Report
Sales Report - "Q4" → Sales Report - Q4 or Sales Report - Q4 (quoted)
2) Date-like names (23/12/2025)
/ is also not a safe character for names (it’s a path separator), so the service normalizes it. In some cases it also tries to interpret date-like strings and ends up shortening/transforming the title (your 2025 result).
Fix: use a safe date format in the name, e.g.:2025-12-23
20251223
23-Dec-2025
Recommended approach
Always generate a “safe” import name before calling the API:allow letters, numbers, spaces, - _ ( )
remove: " / \ : * ? < > |
use ISO date format YYYY-MM-DD
Re: Report Name Conversion Issues (PostImportFile REST API) – Explanation and Workaround
Hello! These issues are likely caused by how the PostImport endpoint handles character encoding and "auto-typing" during the initial file upload process.
Issue 1: Double Quotes and "No File Model"
The "No File Model" error is a generic fallback name the Service uses when the metadata portion of the multipart request is corrupted or fails validation. When you include unescaped double quotes in the displayName, it often breaks the JSON boundary or is rejected by the API's security sanitization layer to prevent injection.
Issue 2: Date Formats (23/12/2025) converting to 2025
The Import API's parsing engine sometimes attempts to interpret strings that look like mathematical expressions. In some legacy versions of the import logic, a string with forward slashes is treated as a division operation, or it defaults to the last numerical segment if it fails to validate as a standard string.
The Recommended "Pro" Workaround
To avoid these limitations, the most robust architecture used by developers is the Two-Step Deployment Pattern:
- Step 1 (Upload): Import the file using a "Safe Name" (alphanumeric only, no special characters or slashes). This ensures the file is accepted and the model is created without metadata corruption.
- Step 2 (Rename): Immediately follow up with the Reports - Update Report In Group API.
The Update Report API is designed specifically for metadata and is much more resilient. It handles escaped double quotes and date strings correctly because it is a simple JSON PATCH request rather than a complex multipart file upload.
// Example Step 2: PATCH https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}
{
"name": "23/12/2025 - \"Sales Report\""
}
I hope this helps you stabilize your automation! If this architectural workaround resolves your issue, please mark this as an "Accepted Solution" to help others in the community.
Best regards,
Vishwanath