Find and Replace Macro
- 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
Muddling my way through a find and replace macro and needs some help to get over the line.
I've set up the macro as follows, the fields im trying to cycle through and the replacements are shown in the excel input further below. I need to feed the fields through the control parameter, I've set up the macro template and the action type as update value with the text 'Region' as the string to replace with the other fields, the replaced string adds F or R for the find or replace fields. The Macro input tool is the data I am cleansing. If I have a list of all field strings to replace 'Region' in the template, how do I feed that to the control parameter so it works?
The MasterDataCleanse.xlsx is as below:
- Labels:
- Macros
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
OK I created a table for the control parameter to loop through to replace the string which changes which field is being iterated in the find and replace.
The issue I have now is an error saying the the Data input into the macro (the data with multiple fields that are being cleansed via Find and Replace) isn't fully mapped?
If I look on the questions tab of the macro tool I see this:
There are no fields to choose from as they are all 'taken'. I'm confused why this is even necessary as the Close Date and Amount fields aren't being cleansed by the macro? They are just part of the input data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Inside your macro Input tool, remove all the columns that are not necessary for the macro to work. Ideally this would leave only the field that you're replacing. That will leave only the mapping question for the field that the macro will act on. Any extra fields that are used in the main workflow will just be passed through the macro.
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The field Im replacing will change based on the control parameter, the input is now trimed to be just the 7 fields that would potentially have replacements, just field headings no data (not sure if this is necessary). Looks like this:
This is what is fed to the control parameter:
The action tool in the macro is setup like this on the find and replace:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The macro is outputting without an alteryx error but the find and replace isn't working in the main workflow (but works in the macro template) and also my output rows are 7 times the input rows so its multiplying the rows by the control parameter. No idea how to make this work.
