Power Automate Invalid File Name

KS 20 Reputation points
2024-08-18T07:33:36.4366667+00:00

Hello,

I'm working on a Power Automate workflow that takes and excel file in a Sharepoint folder, and creates a duplicate version with the date appended to the file name before the file extension. I've run into an issue with the creation of the new file name that is generating an invalid file name. Below is the code I'm using to create the new file. The output of this is being used in the next, Create file, step to generate the new file.

concat( split(triggerOutputs()?['headers']['x-ms-file-name'], '.')[0], '_', formatDateTime(utcNow(), 'yyyy-MM-dd'), '.', split(triggerOutputs()?['headers']['x-ms-file-name'], '.')[1] )

I'm really new to Power Automate so any and all help will be greatly appreciated.

Starting file: "Payroll Register.xlsx"

Desired outcome: "Payroll Register 2024-08-18.xlsx"

Thank you.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,341 questions
{count} votes

Accepted answer
  1. Syed Saleem Peera 6,485 Reputation points Microsoft Vendor
    2024-08-19T14:07:43.5466667+00:00

    Hi KS,

    Thank you for reaching out to us on the Microsoft Q&A forum.

    This topic is currently not supported in the Q&A forums.

    I recommend initiating a new discussion through the Power Automate Community platform Moderators are readily available there to assist you and provide guidance.

    Please don't forget to Accept helpful answer and close this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.