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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (27,276)