web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / "Invalid file name" er...
Power Automate
Suggested Answer

"Invalid file name" error in Create file action on Power Automate

(0) ShareShare
ReportReport
Posted on by

Hi everyone,

 

I'm experiencing a recurring issue when trying to create an Excel file in SharePoint using Power Automate. The Create file action keeps failing with the following error

 
Action 'Create_file' failed: Invalid file name
 

The file name is generated dynamically based on Microsoft Forms responses, using this expression:

concat(
replace(replace(replace(trim(outputs('Get_response_details')?['field1']), ' ', '_'), '-', '_'), '/', '_'),
'_',
formatDateTime(outputs('Get_response_details')?['field2'], 'yyyy_MM_dd'),
'.xlsx'
)
 

The output looks valid, e.g.:

Test123_2025_06_14.xlsx

 

If I use a fixed name like test.xlsx, it works perfectly.

 

I’ve tried replacing special characters, changing the folder path, and verifying permissions, but the issue persists.

 

Has anyone encountered this before or knows what might be causing the problem?

 

Thanks in advance!

Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,969 Moderator on at
     
    The issue is, you are only showing us the file name, we need to see the whole thing so we can figure out what the path is.
     
    before you try to use Create File, add a Compose
    in the compose, but the entire path + file name that you plan to use.
     
    You should be able to just look at it and go oh.. lol thats not correct, as the file name is fine.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard