I have a batch macro that makes calculations on a set of 3 fields. The trios are fed into the macro, macro calculates and logs results for each set of 3, one under the other.
The problem is that my set of fields sometimes are incomplete, instead of feeding the macro the 3 fields, only feeds 2, or 1. In this case I would like the macro to ignore that set and continue with the rest.
As of now, these errors means that the macro doesn't give any output.
I looked into detours, but it don't know how to feed the route to the detour.
I tried a filter, which is what I put in the sample workflow, but makes no difference.
I am attaching a small work flow with sample of data and the part of the macro that would need to have the error handler.
Any suggestion will be greatly appreciated!!!!
Thank you!
Solved! Go to Solution.
Thank you so much @gabrielvilella !!! That was a great idea, but I still don't know how to avoid the macro going into certain branches that require data for Field 1. I added an example in the workflow. I linked to iteration 1 so you can see it working.
No problem! What needs to happen if there is no Field 1? Maybe the detour will be the way to go. If you could please insert a branch for when there is no Field 1 would be helpful.
The version 3 I uploaded on my reply has one of those branches. Let me know if you cannot see it. This is my first time posting, so I may have messed it up :p
So, I did this to test iteration 2. I can see the nulls. Should the data go forward to the container 5?
Data wouldn't need to go forward to Container 5.
Ideally, once we know that there is no Field 1, should stop calculations. Calculations would be inaccurate anyway, but , if we figure out a way to stop the macro from failing, I could add a message in the output to ignore results. Not ideal, but would still help.
With that control I pass the Name of the field, and I pass the name of the file to look in. Inside the macro that name may or not be found in the file. Hence we only know if the field exists inside the macro. The condition would need to be in between reading the data and the calculations.
I was hoping to only have the macro opening the file once grab the data and do its stuff.
I suppose I could check the existence of the full sets before I run the macro and run it only on pre-vetted trios.
This means I have to open the file before calling the macro and in the macro. (right now, like I said, I only pass the name and use a dynamic input within the macro). Not the end of the world :)
If you can't think of a better way, I will go with that.