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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / When copying a file in...
Power Automate
Answered

When copying a file into other library, not getting the content file correctly

(0) ShareShare
ReportReport
Posted on by 501 Season of Giving Solutions 2025
Hi!
 
So I am trying to copy files with some property columns into another library but its hard to get. The thing is I created this flow:
It creates a file getting content from a file in another library, but when running, the error says "Resource not found":
 
What can I do?
 
Captura2.JPG
Captura1.JPG
Categories:
I have the same question (0)
  • Charlie Martharper Profile Picture
    501 Season of Giving Solutions 2025 on at
    Hi @Tomac
     
    I talked to the SP forum site and they told me that when action fails with NotFound is because the path it's not correct (which it should).
    Maybe one of the folders it's not exactly the same but I copy paste them from the other library so I shouldn't be having this problem.
     
    But that could be the error because the file is created, without any content, it appears the file in the folder, but when open it, it's blank.
     
    So, the path it's correct, what we should focus now it's on the content I guess
     
     
  • Tomac Profile Picture
    4,042 Moderator on at
    After a screenshare session this morning we got the folder paths and filename working properly.
     
    The issue now appears to be the on-prem connector and Create File - the file is created with the correct body in the action, but the file content is empty when checking SharePoint and the action fails with the error Resource Not Found.
     
    @Michael E. Gernaey any ideas on this issue?
  • Charlie Martharper Profile Picture
    501 Season of Giving Solutions 2025 on at
    Hi Tomac,
     
    I send you an email. 
    No, the values are coming from trigger outputs so the select I am using there, look:
    Here I have a multi value choice, so if it's created in more than 2 "Ambits", it should create the same file in both folders, So I think an apply to each is missing. I have Value - split(item()?['Value'], '|')[0]
     
    Then in the create file I have like the route, everyting getting it from Triggeroutputs.
     
     
    What should I change? Tell me if you received the mail correctly 👍
  • Tomac Profile Picture
    4,042 Moderator on at
    These values are coming from the Get Items action, yes? Can you post the full output of that action (or email it to me if you're concerned about privacy, my email address is in my profile) so I can see what Power Automate is working with there?
  • Charlie Martharper Profile Picture
    501 Season of Giving Solutions 2025 on at
    Hi Tomac
     
    It seems the copy file it's not supported with the on premises data gateway. So I can't use this i think
    So I used Create file but I have a problem now with the create file Ambit values. It gets the term guid code, and then it doesn't runs propperly. 
    I am getting this folder path: 
     
    /Biblioteca Troncal/[{"Value":"Biblioteca Camp de Tarragona"}]/{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Ciutadania"}/Acollida a nous professionals/Comunicació problemes i oportunitats de millora/
     
    How could I do to get them right?
    When I put ambit value or departament value, it creates an apply to each and it also not running. I guess is that but dont know how to get it right.
     
  • Suggested answer
    Tomac Profile Picture
    4,042 Moderator on at
    You need to remove item() function entirely:
     
    replace(triggerOutputs()?['body/{Path}'], 'Documents compartits/', '')
    And if that doesn't work, check the localized version of the body/path dynamic content.
     
    You won't use an Apply To Each here.
  • Charlie Martharper Profile Picture
    501 Season of Giving Solutions 2025 on at
    Hi @Tomac
     
    Ok so I have this now but it returns an error too:
    replace(item(triggerOutputs()?['body/{Path}'], 'Documents compartits/'''))
     
    The error: Unable to process template language expressions in action 'Copy_file' inputs at line '0' and column '0': 'The template language function 'item' must not have any parameters.'.
    I tried the apply to each and input path of the trigger but i get this error too
    That would replace that part, and it could start from "Assegurament i accés..."
     
     
    What should I change?
  • Suggested answer
    Tomac Profile Picture
    4,042 Moderator on at
     
    It looks like you copy/pasted this from the other flow, yes? The item() function only works inside of a loop-structured action (Apply To Each, Select, etc) where the action steps through a series of items.
     
    In this case, instead of "item()?['Carpeta']" you'll use the trigger output Path: triggerOutputs()?['body/{Path}']
     
    think this would be triggerOutputs()?['body/{Carpeta}'] in your environment, but you'll want to verify that
  • Charlie Martharper Profile Picture
    501 Season of Giving Solutions 2025 on at
    Hi @Tomac!
     
    The replace I am using is this: replace(item()?['Carpeta'], 'Documents compartits/''')
     
    It replaces the first "Documents compartits" in the item column list:
     
    Ambit Value + Departament are these 2 columns:
     
    So the library is Biblioteca Troncal/Biblioteca Camp de Tarragona/Ciutadania/(and then it should start in "Assegurament accés al sistema sanitari")
     
    Thanks again for your help! I thought it could be almost the same as the other.
  • Tomac Profile Picture
    4,042 Moderator on at
     
    This error is saying your replace() function is bad:
     
    Can you provide the full expression you're using here? The first argument in yours is coming back as NULL.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 258 Super User 2025 Season 2

#2
trice602 Profile Picture

trice602 205 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 204 Most Valuable Professional

Last 30 days Overall leaderboard