Logic App write list of names in txt

clouddataquest 91 Reputation points


i made a Logic App which takes every hour all files from one path and moves it to another path with a timestamp in the name. Now i want to make log txt file but just ones a day and the content should be the name of every file which was moved (with the timestamp)

For example:

RootFolder : File1, File2
DestinationFolder: 2022_File1, 2022_File2
LogFolder: log_X.txt -> content: 2022_File1, 2022_File2

my Problem ist idk how to get the list of the files, i only can get the last moved file

i hope someone can help me, thank you very much

best regards

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,931 questions
0 comments No comments
{count} votes

Accepted answer
  1. MayankBargali-MSFT 69,841 Reputation points

    @clouddataquest Thanks for reaching out. Please update your workflow as mentioned below

    1. Make sure that you are running your loop in the sequential i.e. enabled the Concurrency Control and set the Degree of Parallelism to 1 on your loop settings.
    2. As the Create file action (for the log file) is inside the foreach loop so every time it will try to create the file and if file already exists then it will overwrite the file with the new content. So, you need to first check whether the file is already created or not. If it is created, then get the file content and add the new content else create a new file.

    For your reference sharing the code view. I am only sharing the condition to verify if the file is already created or not by checking if the status of the action is 404 or not. Please modify it as per your business requirement and test it with your use case. You can refer to actions function and Configure run after behavior that I have leverage in my below workflow.


    Feel free to get back to me if you need any assistance.

    0 comments No comments

0 additional answers

Sort by: Most helpful