Skip to main content
February 26, 2026
Question

How to read csv file from Documents/users folder?

  • February 26, 2026
  • 2 replies
  • 0 views

Hi,

I have been trying to read a csv file that is in Documents/Users/userxxxx folder. Not able to make it work. Getting an error.

Below is the code

Dim FileName As String = args.NameValuePairs.XFGetValue("Param1", String.Empty)
            Dim sourceFolder As String = $"Documents/Users/{StringHelper.RemoveSystemCharacters(si.UserName,False,False)}"
            Dim fullPath = sourceFolder & "/" & "abc.csv"
 

Below is the error

Could not find file 'P:\Program Files\OneStream Software\OneStreamAppRoot\OneStreamApp\Documents\Users\userxxxx\abc.csv'.

Any idea why this is not working?

Thank you,

Mikki

 

2 replies

February 26, 2026

Hi Mikki​ 

Documents/Users in OneStream represents the Application Database e.g.



 

 

 

 

This means the file is stored in a database table and not a real file path.  This is why you are receiving an error trying to use a UNC path.  If you search GetFile in snippets you will see this BRApi example



It is not clear what you are trying to do with the file itself.  But here is a working example to get the file as bytes from Documents/Users using BRApi's available

Dim folderFullName As XFFolderEx = BRApi.FileSystem.GetFolder(si, FileSystemLocation.ApplicationDatabase, Path.Combine("Documents/Users", StringHelper.RemoveWhiteSpace(si.UserName)))
Dim objXFFileEx As XFFileEx = BRApi.FileSystem.GetFile(si, FileSystemLocation.ApplicationDatabase, Path.Combine(folderFullName.XFFolder.FullName, "YourFileName.csv"), True, True)
Dim fileBytes As Byte() = objXFFileEx.XFFile.ContentFileBytes()

Hope this helps

Sam

MikkiAuthor
February 26, 2026

Hi Sam,

I am trying to read the file as datatable so I can load to table. I guess then I have to find a way to export the data to File Share and read it from there. This is something that is one off process that we are going to need to do as part of upgrade.  

Thank you,

Mikki