You are viewing limited content. For full access, please sign in.

Question

Question

"for each file" not working

asked on November 26, 2021

I have a simple workflow that is trying to get all csv files in a windows directory and send them as an email attachment.

I use this technique in another workflow with no problem but it always uses the same file name, however this one returns no entries.

It uses a token to specify the folder

but it doesn't return any files no matter what I have tried.

There are currently four files in the folder but the workflow doesn't process them.

No errors are returned.

I used a Track Tokens activity to see the folder path was valued

so I am baffled as to why it returns nothing.

I have deleted and re-added the entire workflow in case something was cached, no joy.

I tried using a wild card for *.csv, no joy.

I tried checking the include subfolders just for fun too, but again, no joy.

I checked file browsing option and it is enabled

 

 

0 0

Replies

replied on November 27, 2021

In the Email activity, when you add attachment, in the popup, change the Attachment Type from Entry to File, then select the For Each File Current File as file to attach

2 0
replied on December 15, 2021

I had already done what was suggested by changing the email attachment to a file vs. entry but that was no the issue.

I added some show token steps and found it was not going into the for each loop at all.

I got it to work somewhat better by hard coding the path to the windows directory with no ending slash.

I say somewhat better because it only processed 4 out of 8 files but at least it is now doing something.

0 0
replied on December 16, 2021

Check to make sure that the account that workflow runs as has permission to the folder containing the files.  I've had similar problems using Import Agent and the service account has no rights to the folder. 

0 0
replied on December 16, 2021

Thanks for the idea but it works for some of the files so it has to have sufficient permissions to see the folder and manipulate the files.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.