9

I have an Azure Logical app that every hour gets a file from a website and create a file in OneDrive. Since the file does not have a dynamic name, it gets replaced every time. Is there a way to put the current date time in the filename?

Thank you, David

dreftymac
  • 31,404
  • 26
  • 119
  • 182
user3195568
  • 131
  • 1
  • 1
  • 4
  • 1
    if you are using File connector or Onedrive connector when you call the PUT method to upload the file you will be passing the full filepath including the filename right. You can append the @{utcnow()} to the filepath. utcnow() function provides the current UTC time . https://azure.microsoft.com/en-us/updates/create-connectors-in-logic-apps-designer/ – Aravind Feb 07 '17 at 06:34

2 Answers2

8

@Rodrigo Daruich Alvarez's answer got me in the right direction but the format wasn't quite right. The below worked for me

concat('file',string(utcNow('yyyyMMdd'),'xls')

the formDataValue didn't seem to work.

documentation here

Joshua Duxbury
  • 4,892
  • 4
  • 32
  • 51
0

you can add dynamic content on filename input:

file logic apps

and add expresion:

concat('file',string(formDataValue(utcNow(),'yyyyMMdd')),'xls')