I built a workbench that creates 2 excel files with unique names that are created use the Fanout Dataset in the excel writers using a filename attribute that creates the unique file name. However, when I run workbench in FME Flow to set up the automation, it says it created it successfully, and the log seems to show that the files were created with the unique names, however, there are no files to open at all in the destination folder that I set up for it on FME Flow. Please help. Thank you!
Pic of the fanout in the workbench. I have tried to add the log file to this post but it will not let me as the file type is “log” and for some reason the FME Forum system does not allow for those files to be uploaded.
Best answer by pauldeq
Okay, We finally got it to work. So you have to use a feature writer with your filename attribute in the dataset field. Make sure to set the destination to be an FME Flow directory for the dataset field. Then add the @Value(FileName) at the end of the destination. Change your dataset name in the “Summary Port” to something unique. Since I had 2, I named one of them CustData, and the other BillData.
Then use 2 Attribute Managers, one for each Feature Writer and add a generic column “Code” with static value of 1 for each of the attribute managers (you will use this field to merge on in the feature merger).
Then create a feature merger with the 2 attribute managers joining one to the Requestor and the other to the Supplier on the Code field.
Then use a List Exploder on the merged output with the List Attribute = _feature_types{}
Then use a FME Flow Automation writer and call it EmailAttachments.
Then upload the workspace to Flow. and set up the automation. Use an action to run the workspace. Then apply it to get the other output with the “EmailAttachments” to connect to an email action.
In the Email Action, hit the ellipses in the email attachment, and chose your dataset name. Since I had 2 attachments, I chose one of the datasets and then hit the down arrow next to the email attachment field and clicked on Text Editor to then add the other dataset as seen here:
Then I ran the workspace and voila it worked! Hope this helps others. Below are the tranformers and images of my workspace and automation. Enjoy! :)
Feature Writer to FME Flow Automation WriterAttribute Manager adding the Code ColumnFeature Merger on the Code Column. Only need to use the Feature Merger because I had 2 Feature Writers, which meant 2 attachments.List ExploderFME Flow Automation WriterFlow Automation with the EmailAttachments output
Write permissions. If you are writing to a destination outside your Flow Install Flow or the user account using flow may need r/w/c permission to the destination location.
Flow also needs UNC paths. So \\server\location not J:\location
You could try and publish with Download option enabled and see if you get a dl link after running. This will confirm if there are in fact features being written. I do not think a file will actually be created if 0 features are written.
Thank you for the reply, so I set the file to be saved inside of the flow resource/data folder. I set up all my workbenches to put the excel file into the resource/data folder (not specifically that folder, but I set up a few subfolders to keep all the outputs of each automation organized). I will try the data download and let you know if that works. By the way, the log file shows that features were created and that both excel files were also created, but I never could find the files.
So I tried the Data Download, but for some reason I can’t access the url for the zip file in the emailer action on Flow. When I just run the workspace in Flow and set it to use the data downloader option, it runs and gives me a url, but then when I try to access the parameter that generates the URL, its not there for me to add it to the email body of the emailer action. This is getting very frustrating :(
Well I have tried a number of things and nothing seems to work. I have gone back to trying to make the dynamically named files get attached to an email action in Flow. I can get the files to get generated, and stored on Flow, but no files get attached. I am currently working with an FME Support Agent, and will update this once we figure it all out. Thank you, again, for any assistance you have given.
Okay, We finally got it to work. So you have to use a feature writer with your filename attribute in the dataset field. Make sure to set the destination to be an FME Flow directory for the dataset field. Then add the @Value(FileName) at the end of the destination. Change your dataset name in the “Summary Port” to something unique. Since I had 2, I named one of them CustData, and the other BillData.
Then use 2 Attribute Managers, one for each Feature Writer and add a generic column “Code” with static value of 1 for each of the attribute managers (you will use this field to merge on in the feature merger).
Then create a feature merger with the 2 attribute managers joining one to the Requestor and the other to the Supplier on the Code field.
Then use a List Exploder on the merged output with the List Attribute = _feature_types{}
Then use a FME Flow Automation writer and call it EmailAttachments.
Then upload the workspace to Flow. and set up the automation. Use an action to run the workspace. Then apply it to get the other output with the “EmailAttachments” to connect to an email action.
In the Email Action, hit the ellipses in the email attachment, and chose your dataset name. Since I had 2 attachments, I chose one of the datasets and then hit the down arrow next to the email attachment field and clicked on Text Editor to then add the other dataset as seen here:
Then I ran the workspace and voila it worked! Hope this helps others. Below are the tranformers and images of my workspace and automation. Enjoy! :)
Feature Writer to FME Flow Automation WriterAttribute Manager adding the Code ColumnFeature Merger on the Code Column. Only need to use the Feature Merger because I had 2 Feature Writers, which meant 2 attachments.List ExploderFME Flow Automation WriterFlow Automation with the EmailAttachments output
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.