FilePath in WriteCSV

datatable
csv

#1

Hi,
im a beginner in UiPath. I was wondering is it possible to save the csv file from Write CSV activity, to any desktop. For example, if im running the application locally, my path to desktop is “C:\Users\myname\Desktop\file.csv”, but is it possible, that instead of having an exact path, it accepts anything in that place, it the application is run on different computer (where the path is also different). I tried “C:\Users*\Desktop\file.csv”, but it did not work, like * works as a wildcard in selectors. Thank you in advance!


#2

Hi and welcome,

You can use Environment.UserName to get current logged in username, which then you could use in your path:
Simple example:
`“C:\Users” + Environment.UserName + “\Desktop\file.csv”

Regards.