Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Setting sharepoint filename and folder path using variables

(0) ShareShare
ReportReport
Posted on by 13

Hi,

 

I'm currently using a flow to save a series of daily reports to a sharepoint server.  The process is as follows:

Truck drivers do a daily vehicle inspection report (DVIR) and submit to third party.

Third party software e-mails me a PDF.

Power automate extracts several variables from the e-mail body (some shown below)

 

Everything is working fine, the variables return correctly on the run report (excel sheet populates correctly when I test without variables in the file and folder names), but I'm trying to use those variables to set the folder path and filename, and Power Automate is returning a status 400 code error, saying "Action 'Create_file' failed".  The appropriately named folders do exist.

 

I'm new to Power Automate so I would welcome any comments or suggestions on how to fix this.  Ideally each .pdf will save into a folder named for it's truck (truck variable is an 8-digit integer) and filename format will be something like "2001005 - 2020-08-01.pdf"

 

 

Screenshot from 2020-07-31 00-01-21.png

  • genko Profile Picture
    13 on at
    Re: Setting sharepoint filename and folder path using variables

    Nice catch.  The variable had a \n at the end which made for an illegal filename.

  • Verified answer
    Rahber Profile Picture
    1,935 on at
    Re: Setting sharepoint filename and folder path using variables

    try these do things as well since you can manually create the folders.

     

    Disallow chunking on you create file action (in your properties)

     

    Your variable of Truck seems off try changing to to see if there is an extra thing coming in end.

  • genko Profile Picture
    13 on at
    Re: Setting sharepoint filename and folder path using variables

    Seems like it, eh?

     

    I have permissions for the whole site, but I'm not an owner.  I had initially thought it wasn't permissions because I'm able to create the folders manually from within sharepoint, and because the flow works when I don't use variables to select the folder.  I'll ask to be bumped up to owner and see if that solves anything.  If so I'll return and accept your solution.  Thanks again.

  • Rahber Profile Picture
    1,935 on at
    Re: Setting sharepoint filename and folder path using variables

    This seems like permission issues.

     

    What kind of permission you have on SharePoint? Is it specific to a library or is it site wide?

     

    you at least need edit or owner rights on the whole site to create folders.

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,
    Rahber

  • genko Profile Picture
    13 on at
    Re: Setting sharepoint filename and folder path using variables

    Thanks for your help.  I've added the file extension.

     

    Here's a screenshot of the error message.

    Capture.PNG

  • Verified answer
    Rahber Profile Picture
    1,935 on at
    Re: Setting sharepoint filename and folder path using variables

    one things file name should contain the extension so add .pdf after Date variable in your file name field.

    Also to help you better. Can you please post a complete screenshot of the error message?

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,
    Rahber

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1