Hi all,
I have a workflow that needs to read files from a Box folder located inside the user’s Windows profile directory.
Right now the Directory tool uses a hard-coded path, for example:
C:\Users\anoor\Box\Recon Automation Working Files\Plant 1700\1700 Alteryx Input\ZP2P0015 Inventory Recon. SAP 1700\
The problem is:
When I run the workflow → it works (because I'm “anoor”).
When another user runs it on the same machine
C:\Users\<whoever is logged in>\Box\Recon Automation Working Files\Plant 1700\1700 Alteryx Input\...
I tried using GetEnvironmentVariable("USERNAME"), but the Directory tool does not accept formulas or dynamic expressions in the File Path box. It also has no input anchor, so I cannot pass in a calculated path.
My question:
👉 What is the recommended way in Alteryx Designer (2024.2) to make the Directory tool user-agnostic so that any user can run the workflow and access the correct Box folder inside their own Windows profile?
I’m open to any solution that works — batch macro, configuration setting, alternate tool, best practice, anything reliable.
Thanks in advance for any help.
Interesting problem. Can you try entering this path into your directory tool:
C:\Users\*\Box\Recon Automation Working Files\Plant 1700\1700 Alteryx Input\...
The * allows for wildcard searching and the simple test on my end worked. I assume this could work for your use-case as well.
Cheers, -Jay
Hi @abdullah_noor23,
My previously published CSV Friendly Multi-Input (Inspired by CReW Wildcard Input) contains a macro CReW_CFMI_BatchDirectory.yxmcbatch, which also requires CReW_CFMI_NonVariableToIntermediary.yxmcbatch, CReW_CFMI_VariableToAbsolute.yxmcbatch and CReW_CFMI_VariablePathConverter.yxmcbatch to work as a package supporting Environment Variables. Feel free to make use of either the CSV Friendly Multi-Input macro itself or the batch directory macro, which supports environment variables (detailed info regarding this can be found on the Environment Variables Info tab in the interface of the CSV Friendly Multi-Input macro).
Update (2025-11-23): I published the macro NeoInfiniTech Directory, you can use this macro to define any environment variables. The only difference from the Directory tool for the specification of the files is that you will need to specify the file extension and/or wildcard in the File Browse text box, you can alternatively provide a list containing multiple FullPath values as well.
You can make the Directory tool work for any user by making the path dynamic instead of hardcoding your username. A common way is to use a batch macro: set up a control parameter for the username (or full path) and then build the full folder path with a Formula tool. Inside the macro, use an Action tool to update the Directory tool with that dynamic path.
Another simpler approach is to use a Text Input with environment variables like %USERNAME% or %USERPROFILE%, then combine that with the folder structure in a formula. This way, anyone who runs the workflow will automatically point to their own Box folder, no matter their username.
You may consider converting the workflow into an analytics app and using a text box interface to update the user name. This approach helps identify the correct user profile in the Directory tool rather than taking the whole list across different user profiles, especially when more than 20 users are working on the same machine. Hope this helps
