Batch Macro from csv file doesn't put the FileName through in the workflow
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have got n files in a directory, they are partly .xlsx and partly .csv
I want to append all of them to one table and add a datetimestamp and also add the source file as a field.
I have created two batch macros, one for each file type which within the macro both do what they are meant to (adding a column FileName and datetimestamp).
However, when I pull these two macros into a workflow to create one single table which I output into my MySQL database, the FileName column disappears from the output.
I struggle to understand why something that is output within my macros is not output from my macros the same way in the workflow.
Thank you!
PS: the dynamic rename is just to normalise the field names for the union "by column name"
Solved! Go to Solution.
- Labels:
- Batch Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Could you provide some dummy data or package it as an Alteryx Package (.yxzp)?
Are you saying that the FileName up till Union exists, but disappears at Output only?
Have you tried enabling this?
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi there, thanks for your quick reply. I'm attaching data from one of the files.
Sorry, this wasn't clear, the FileName is not available at all in the workflow.
It is available within the Macros but when I use the Macros in the workflow the FileName doesn't exist even right after the macro as shown in the select tool in the screenshot of the workflow below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@sabrinapwnd - your issue is that your action tool to your csv macro is not configured correctly. It is only reading in one file (the one you set it up with) - not all of the files in your directory. It may be reading in that file multiple times - but it's only reading in that one file.
Your action tool as set up is updating the outputfilename property in the action tool with the name of your csv file - that's not going to work. that controls if you are outputting the filename and if you want to output the fullpath or the filename. The value there should be 'FileName'
Like with your .xlsx macro - you want to update the read path - in this case it's File - Value. If you edit your macro to select that you will see the csv's filename (and all of the csv files)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Amazing, this was exactly it! Thank you so much :)
