Loading txt file to custom table

MStucchi
New Contributor III

We are trying to load txt file to custom table using LoadCustomTableUsingDelimitedFile but when it runs we receive a "Data load file is invalid or missing" error. The file is manually selected from a folder. 

The file is correct, the number of fields in the file and in the table match, the values and the field type match and the field separator is correct.

We are uploading the file from a Dashboard button component which calls a Dashboard extender BR.

This is the BR code:

 

Dim filePath As String = args.NameValuePairs.XFGetValue("FilePath")
Dim tableName As String = args.NameValuePairs.XFGetValue("TableName")
Dim loadResults As TableRangeContent

Dim fieldTokens As New List(Of String)

fieldtokens.add("field1")
fieldtokens.add("field2")

...

fieldtokens.add("fieldn")

loadResults = BRApi.Utilities.LoadCustomTableUsingDelimitedFile(si, _
    SourceDataOriginTypes.FromFileUpload, filepath, Nothing, ";", _
    "Application", tableName, "Replace", fieldtokens, False)

Return loadResults

 

Any siggestion really appreciated.

Thanks and regards

1 ACCEPTED SOLUTION

Where are you loading the file? Is that to a file share path? The load can be done from File Share only.

Look at Solved: Unable to load from Excel file to custom table - OneStream Community (onestreamsoftware.com)

View solution in original post

2 REPLIES 2

Where are you loading the file? Is that to a file share path? The load can be done from File Share only.

Look at Solved: Unable to load from Excel file to custom table - OneStream Community (onestreamsoftware.com)

MStucchi
New Contributor III

Thanks, moving to the file to the share path worked.

As the file is received by email, we are looking on how to select it from local folder and move it to the share path before is being loaded.

Thanks and regards

Massimo