I'm new on Microsoft Power Automate and I'm trying to built a flow. This flow can be summarised like below:

  1. Receive Email
  2. Save Attachments to OneDrive
  3. Copy OneDrive file to another OneDrive Folder (there are problem at this point. The file name can be changed for every email attachment and I need to get current file name to process other stpes. I've tried to use expressions to get generic name. First I've initialized a variable but I couldn't use it anywhere. Then I try to get the file name such as :concat('/xxxx_folder/',variables('name of initialized variable') but it didn't work.
  4. After getting the file I need to get excel files and copy to another template excel file.
  5. And final step is sending this new file as attachment with an email.

Is there any way to get unspecified file name and use it in other steps? Thank

1 Answer 1


I'm assuming you were able to complete steps 1 and 2. For your step 3, you can use "List files in folder" action from OneDrive and then loop through all the files using "Apply to each" and copy files to another OneDrive folder using "Copy file" action.

As can be seen in the screenshot, file Names are available from the dynamic content, and can used for other processing.

See the screenshot below

enter image description here

Let me know if you have any other issues.

  • Dear Matiur thanks for your reply. It's very useful for me. I'll ask if I have any problem, because the case which I'm working on it is a bit complex and I'm new at Power Automate.
    – Beyza
    Sep 21, 2020 at 6:29
  • I could get the file name and I can add values as row to the another excel sheet. But now I have another problem with the duplicate rows. When I add the new file and new values, existing values are duplicated. I have applied filter array but it didn't worked.
    – Beyza
    Sep 21, 2020 at 14:08
  • Not sure I understood your requirements. Could you explain it in details with examples? Sep 21, 2020 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.