Alteryx Designer Desktop Discussions

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

copy paste macro system will automatically change the relative path to absolute path

aeolus187
8 - Asteroid

Hi Alteryx engineer,

 

copy paste macro system will automatically change the relative path to absolute path, when we hand over the workflow to colleague, they will be reported that macro is not found, is there any configuration to avoid of this happen?  in addition, the dynamic input always has absolute file path for template as well, can i configure to avoid of it?

4 REPLIES 4
Qiu
20 - Arcturus
20 - Arcturus

@aeolus187 
Maybe you are already doing it, we usually save the macro in the same folder of worflow then insert the macro into worflow, which will have a relative path.
Then deliver the packed workflow, and it works just fine.

A1.pngA2.png

aeolus187
8 - Asteroid

@Qiu 

 

Hi Qiu, 

 

I did save macro with workflow into same folder

My scenario is copy Macro into some other workflow, this produce absolute file path for the copied macro

Qiu
20 - Arcturus
20 - Arcturus

@aeolus187 
I see.
I am sorry but I am not aware of other options.
In my case, if I wish to reuse a macro, I either copy and modify the workflow or inser the macro into the new workflow.

fharper
12 - Quasar

@aeolus187 

Within a given workflow any macro is simply a referenced set of code, in a separate file with a specific name.  The code does not actually exist in the workflow file. 

Alteryx has a defined set of paths to go look for macros and this can vary greatly depending on how the macro was installed/added

C:\ProgramData\Alteryx\DataProducts\ or sub folders

C:\Program Files\Alteryx\bin\***subfolders

 

The above are primarily Alteryx supplied or add-ons you acquire from the community like CREW.  They also vary from Designer only vs Server and from Admin vs non-Admin installs.

 

Your user specified path(s) in Options/User Settings/Edit User Settings/  Macros tab are where you would likely put your homegrown macros.  This generates pointer ini file(s) in the C:\ProgramData\Alteryx\DataProducts\  or the non-admin path if a non-admin install.

 

If you insert or copy a macro from a path Alteryx does not have in its lists...AND....you save the flow in the same folder it will be relative referenced...BUT...if you save the flow to another folder outside the macro path, then Alteryx stores it with absolute path since the flow location is not the same as the macro location and the macro is not in one of the searchable paths. 

 

You can see this if you

  • open a blank workflow canvas
  • add a macro that is in the same folder, say your documents folder
  • then save this new flow to the same folder and call it Test1.yxmd

Open another blank workflow canvas, copy the macro from the other flow,

  1. save to a different folder that is not a subfolder of the one with the macro and it will convert to full path reference.  Call this Test2.yxmd.  It is the only way Alteryx knows how to find it at that point as the macro will not be where the flow is as far as it knows.  Alteryx can't predict you may externally copy the macro to the folder at the time the flow is being saved.
  2. save to a different folder that is a subfolder of the one with the macro and it will use relative reference "..\" for next level down from folder with Macro.  call it Test3.yxmd

You can see this if you do this exercise and then open the resulting flows with notepad or notepad++ to see the generated XML.

Different path folder = <EngineSettings Macro="\\xxxxxcom\Alteryx JLL Team\WorkFlows\EmailWithAttachment vX.yxmc" />

Same folder as macro = <EngineSettings Macro=".\EmailWithAttachment vX.yxmc" />

Subfolder of macro folder = <EngineSettings Macro="..\EmailWithAttachment vX.yxmc" />

 

We are in an organization where it makes sense to have one or more shared macro locations and we add those in our settings so when we create a macro, as a fundamental use is reusability, we save it to a shared location so others can use on their own and or the macro will be found by Alteryx if we share a flow that uses it.

 

If this does not suit then if you make sure to check mark the macro when exporting as a package it will save it as relative path to the externals folder generated by the packaging process and so be unpacked and referenced by the unpacked flow...

<EngineSettings Macro="_externals\1\EmailWithAttachment vX.yxmc" />

But be aware that this is that instance of the macro and not the original source.  if you make changes to the original any derivatives will not be changed without manually tracing and modifying each...which defeats the reusability and integrity aspects of a macro.

 

Labels