Hello,
I am confused what I'm doing wrong that would cause an error when converting a workflow to a batch macro.
I have a workflow that produces the expected results without errors:
I've converted the workflow to a batch macro. When I call the batch macro it can't find the field "member", however in the previous screen shot member is defined and there are no issues with the formula tool #33. What would be causing this error message?
Cheers
Solved! Go to Solution.
Does the file that you are reading when testing the macro has the member field? I know that the one you have within the macro has it.
If you go to the second, 'Questions' window of your batch macro configuration window, you may just need to map it there to make sure the macro is referencing the right field from the input (i.e. if you build the macro with one field and in your live data it's named differently or something):
To enable field mapping, just click on your macro input and make sure it's ticked here (Show field map):
Yes the same file is used in both, therefore the 'member' field is there.
@DataNath I'm using a directory tool to send FullPath field to the macro to loop.
Are you able to share the macro and sample data?
As you're looping through filepaths, is there a chance that this member field is named differently in some files?
The issue could be my inexperience with Alteryx and macros. I was using the DIR tool to list all files in subfolders, there are 15 files in each subfolder. When passing the FilePath to the macro my thought was that the input tool would only use the same file that matches. I think it was trying to process all 15 files in each subfolder, which means the 'member' field is not in all 15 files and therefore the error.
Thoughts?
Yes that'll definitely be the cause of the issue @joesparty. You can read in multiple files with different schema, there's a great article on doing so here:
After this, you could perhaps add a filter that will remove everything where the [member] field is null, before continuing on down stream as you wish.
@DataNath thanks for the confirmation and link. How can I pass/filter multiple files if the input macro accepts one input?
In the screen shot below I was able to pass "File 1" filter to the macro and it worked. File 1 has 4 fields that need to be appended to File 2 in the macro. I can't pass "File 2" filter to the macro.
Here is the view of the macro where File 1 works. I want to process File 2, then append fields from File 1.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |