I have macro where show the ‘Show field map’ is checked. I want to create where where only some of the field are mapped instead of all the fields. Is this possible in the macro or some other custom tool?
Here is a visualization of the macro.
Solved! Go to Solution.
You need to map all inputs for a macro. There is no concept of an optional field.
The CReW macros have one allowing you to ensure all fields are present and adding in place holders for missing ones.
See http://inspiringingenuity.net/2013/08/14/alteryx-ensuring-fields-are-in-a-data-stream/
You could use this in conjunction with a Select Tool to prepare the input (renaming fields to required names) and remove the FiledMap from the macro.
If you manually add a dropdown interface which takes as its values the fields from the macro input, you can allow [none] as an option. From there, you could use a Summarize tool to identify fields with no values populated, and use that to drive a Select tool to remove the fields from the output.
When you allow the Macro to show the field map, it will require you to match every single field, not just the ones you need.
I built a macro like this, and I use it every day. Keep meaning to post it to the gallery, so I'll post a link when I do.
EDIT: Here it is. It's a bit of work to add new 'standard' fields, but once you do, it works nicely. Hope you find it useful.
https://gallery.alteryx.com/#!app/Standardize-and-Select-Input-Fields/56c4a0cca248970ce0bb18ab
Is there ever a case where the tool wouldn't let you map fields in the drop-down menu? Currently having this problem.