Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Passing Directory field from Directory tool to macro

tkong
7 - Meteor

So hopefully this is a really simple one, thanks in advance!  So i've pulled the directory for a given share drive which is \\smb.waunas21f..... etc.  Now it is then being passed to a macro where it is going to update a formula.  But it gives the error attached:

7 REPLIES 7
gabrielvilella
14 - Magnetar

I'm sorry, but it is not possible to determine what is wrong based on the information provided. We need to see the data that is going into the macro, what is the tool that is being updated within the macro, how it is being updated, and what operation is being performed with that data within the macro. What it looks like is that you are trying to get the date from the file name and do something with it, and the format or type of the data does not match what you are trying to do.

tkong
7 - Meteor

looks like my company blocked the screenshots.  I am passing the directory field from the directory tool.  it goes into a macro where it updates the assigned formula.  what that formula is doing is creating a new field called "keydir" and basically filling down the records with the value in quotes "\\smb.waunas21f....." with the new row of data being passed to it.  In the macro, it is using action tool and control tool on the formula, replacing the text in the formula to the new directory value.  It is a V_WString

gabrielvilella
14 - Magnetar

The issue is probably on the formula, the value that is coming from the control parameter is not what the expression is expecting to receive. Maybe the data type. I would only be able to fix this by seeing the actual data. 

tkong
7 - Meteor

Here's the files, thanks again

tkong
7 - Meteor

the error is Apply Keydir (28) Record#1: Tool#6: Parse Error at char(0): Parse Error (Expression #1) and it continues through all the records.  the confusing thing is that the workflow passes "Directory" field from directory tool and character "0" is "\" from the string \\smb.waunas21f.hcsc... etc.

wdavis
Alteryx
Alteryx

Hi @tkong 

 

It is a bit trickier to troubleshoot without the data. One option to test would be changing your double quotations to single quotations in the expression of the formula that sits in the batch macro for the "KeyDir"

 

Thanks

Will

tkong
7 - Meteor

@wdavis - tried to change the quotations to single quotations but that did not work, i edited the formula tool quotations and action tool quotations.

 

How can I include the data?  I am trying to use the export function but that is not keeping the data.  Putting a output file tool after the select (20) tool generated the file attached.

Labels