Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Dynamic Field Selection Batch Macro Not Working: not sure why

bsharbo
11 - Bolide

Hello everyone. I am trying to produce a batch macro that would allow end users to pass in a datastream, and also a comma delimited list of columns they would like to keep from that datastream. I want to accomplish this using the update action "update inner XML"/

 

However I am running into the error that "no Fields have been selected for output" when trying to test my macro, and I can't figure out why.

 

I actually built something extremely similar using the transpose tool. I built a tool taht would take a list of "key fields" and would transpose a dataset across all of the columns by those keys.  In theory I had thought this should work the exact same, but I am clearly missing something.

 

 

Does anyone have any insight into why this macro might not be working?  Thank you very much for your help!

 

 

Note: I believe there is a work-around solution where I could use the dynamic re-name and select tool to keep only the columns I want, however I was truly hoping to solve it using the XML method...  if the XML method isn't possible I would like to understand why more clearly! :-)

 

3 REPLIES 3
anthony
11 - Bolide

Hi, I took your string and inserted into full xml and used the update outer xml option and it worked... i think.

 

'<Configuration><OrderChanged value="False" /> <SelectFields><SelectField field="'

+ Replace([#1], ",", '" selected="True" /><SelectField field="') +

'" selected="True" /> </SelectFields></Configuration>'

 

abc ttt
1 3

 

i added xyz as input and got

abc xyz ttt
1 2 3

bsharbo
11 - Bolide

Anthony, your solution is perfect and accomplishes exactly what I need.

 

Do you have any insight into why you would have to replace the entire outer XML in this case instead of just replacing the inner XML?  I am a little confused as to when the outer is necessary versus when updating the Inner is Necessary... In both cases I would have expected that the XML should have been the same (clearly it wasn't) according to my logic, but one worked and the other didn't...

 

 

 

Thanks for your help!

 

anthony
11 - Bolide

Your guess is as good as mine but i assume its inner xml is something different than we think it is - i just tried putting the select xml into the xml parser and it returns 2 INNER XML so maybe that is it? I think i tried deleting the unknown when i first tested and it did not work but maybe that was someother step.

 

Capture.PNG

Labels