I would like to explain how to know what’s happeninng in your macros at this post.
Alteryx Macros are tool-like features that have several tools inside them to achieve new logic. It is useful when you use the logic which you make in another workflow. It is also an essential feature when implementing special repetitive processes such as batch macros and iterative macros. However, once the trouble is occurred, since the problem is hidden inside the macros, so to understand it is a little difficult. It is good point and also bad point.
How to understand what’s happening in the macros
There is an option “Show All Macro Messages” in Designer.
When you don’t use this option, the macro in your workflow shows only the minimum messages. But when you turn on this option, you can see all the messages from the macros in your workflow.
Example
I would like to consider the below workflow with the macro which reads the product master.
When you change the option” Show all Macro Message”, the logs in the Result Window show as follows.
To turn on that option, you can see all the logs in the macro.
What happens if there is a problem?
Now, let’s say that the master file being loaded within the macro has gone wrong and cannot be loaded. For example, suppose the data part went away and the data can no longer be read. But in this case, Designer read the data as 0 records, so there would not be no errors. Such the logs are below.
In this case, the data should be output but the product master has no data, so the output is null. I think that the people who use the BI tool with this data will complain to you. When you could’ve see all the logs, you would be able to find that the product master is anything wrong. So, if the option “Show All Macro Message” turn on, you can see the red box part as follows.
But when you use this option, the logs file size would be huge. So, it should be shown the minimum needed logs. In such the workflow, you can put the Message tool into the workflow. For example, you can put the Message tools showing the record count after the Data Input tool and showing the Product master is fine or not after the Join tool.
The important point is that the Message Priority is set to High because the message will be shown without “All Show Macro Message” option.
You can use the value inside the workflow for the message expression, so it is better to use the file name or data count to be able to seen at the workflow which is set the macro.
In this case, I set the Message tool’s Message Type to “Message” because I don’t want to stop the entire workflow by error. If it is critical and want to stop the workflow, you can set the Message Type to “Error”.
From this, you can show the message without the option “Show All Macro Message” as follows.
This way is a bit time-consuming. So, using “Show All Macro Message” option is useful. But if there is too much message, you might be missed the important message. In that case, it is better to use this way. And because it depends on the people who uses the macro, they might not to use the “Show All Macro Message” option. So, using the Message tool with high priority, which forces the message to be displayed in the upper workflow, can be used universally. I think that this “Bottom Up” approach would be effectively.
Conclusion
- I have explained two ways to understand what’s happening in the macro.
- Set the Message tool with proprity “High” in the macro
- Turn on the “Show All Macro Message” option at the Runtime tab in the Workflow option
- Effective samples for the Message tool
- For batch macros that read various files, use a message tool to let users know what is being loaded, the file name, etc.
- Set it up to notify you of the number of data loaded (especially useful for download tools, etc.)
- When creating a general-purpose macro, provide the necessary information for users as a courtesy.
- Make good use of whether to detect it as an error or to notify it as information.
Sample Workflow Download
The next blog is …
It will be how to rank the records.
コメント