cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
3R-Automation
Helper I
Helper I

Flow keeps recreating file with the same data

I am preparing a CSV file for our accountant which runs on a schedule every Monday.  The file contains the prior weeks employee hours.  When the script runs it prepares the file and saves it to a SharePoint folder, but it then proceeds to attempt to create more than one file and fails because the file already exists.  When I look into the output of the script there are 8 records and in the first file, those 8 records are present.  But in the ActionFailed list, there are 8 fails that contain the same 8 records that the process attempted to add to a file.  It makes sense that it could not write a new file but why is the script making copies of the same records?

 

Build CSV.jpg

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @3R-Automation ,

 

You shouldn't add the Create file action inside the Apply to each, Please delete the Apply to each and add the Create file action directly.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
PrasadAthalye
Super User
Super User

Why are you running Create file in loop? I guess you already have CSV Table and filename. You can directly use Createfile action?

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
v-alzhan-msft
Community Support
Community Support

Hi @3R-Automation ,

 

You shouldn't add the Create file action inside the Apply to each, Please delete the Apply to each and add the Create file action directly.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Actually, I do not know why the apply each gets created.  I managed to do a create file yesterday independent of the apply each.  But on my first attempt to repair the action causing the problems another apply each was created.  I think I have it working without the apply each now. 

I am glad it helped you

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,206)