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

Community site session details

Session Id : Irl3+QpX7fwKOJrdQuXUXt
Power Automate - Building Flows
Answered

Setting sharepoint filename and folder path using variables

Like (0) ShareShare
ReportReport
Posted on 31 Jul 2020 04:26:19 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

I have the same question (0)
  • genko Profile Picture
    13 on 31 Jul 2020 at 20:37:15
    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 31 Jul 2020 at 13:13:52
    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 31 Jul 2020 at 12:50:57
    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 31 Jul 2020 at 12:40:39
    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 31 Jul 2020 at 12:25:48
    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 31 Jul 2020 at 10:20:21
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2