Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Dynamically change file path based on username

Stiofain
6 - Meteoroid

I am connecting to sharepoint and need to create a file path where all team members can access. Is the attached the best way to do it?

 

use GetEnvironmentVariable("USERNAME") & a formula tool to create the new path which will be put into a dynamic input tool
?

6 REPLIES 6
BrandonB
Alteryx
Alteryx

This will work if that path is the same for all users aside from the username. Is everyone on your team syncing the SharePoint location to their OneDrive?

Stiofain
6 - Meteoroid

Yeah all team members have synced to One Drive. Any better solution or is this the way to go for now?

BrandonB
Alteryx
Alteryx

This approach sounds like your best bet for now. You could always wrap it up into a macro if you wanted to package it. This wouldn't necessarily change functionality, but it would make the workflow look cleaner. 

Stiofain
6 - Meteoroid

Ok thanks!

MG_rsm
5 - Atom

It makes sense how to dynamically change the path as it goes into the tool, but how to dynamically change the Input Data Source that is within the tool? 

 

In the 'Connecting to Sharepoint for all users'  example above, I still see C:\Users\myusername\Company\Team Folder\Resources\Dataset.xlsx in the Input Data Source Template. 

 

 

 

Thanks so much for the help!!

BrandonB
Alteryx
Alteryx

@MG_rsm in order to inject a username into a tool you normally have to wrap that tool as a macro with a control parameter and action tool connected that updates that specific value in the tool configuration

Labels
Top Solution Authors