12-21-2021 07:41 AM
Hello - we would like to move specific Forms and Adj data from one application to another - data are extracted via Data Export in DM, does anyone have an example of the Extensibility Rule (BRApi.Finance.Data.SetDataCellsUsingUsingCsvFile) to load the extract data? Many thanks - Wei
Solved! Go to Solution.
12-21-2021 08:23 PM - edited 12-22-2021 08:47 AM
Hi,
Below is an example snippet of using the SetDataCellsUsingCsvFile BRApi. As always, please test in a Development application first!
'get app config settings
Dim configSettings As AppServerConfigSettings = AppServerConfig.GetSettings(si)
'retrieve exported cube data file from a path on the current application's fileshare
Dim folderPath As String = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppName)
'define the full path including the file name
Dim filePath As String = folderPath & "\SomeFileNameFormsData.csv"
'next check if the file exists on the file share...
If File.Exists(filePath) Then
'define the source origin members
Dim sourceOrigins As New List(Of String)
sourceOrigins.Add("Forms")
'define target origin member
Dim targetOrigin As String = "Forms"
'process the file and load the data - do not load zeros
BRApi.Finance.Data.SetDataCellsUsingUsingCsvFile(si, filePath, ",", sourceOrigins, targetOrigin, False)
End If
Nick Kroppe
OneStream Software
12-21-2021 08:23 PM - edited 12-22-2021 08:47 AM
Hi,
Below is an example snippet of using the SetDataCellsUsingCsvFile BRApi. As always, please test in a Development application first!
'get app config settings
Dim configSettings As AppServerConfigSettings = AppServerConfig.GetSettings(si)
'retrieve exported cube data file from a path on the current application's fileshare
Dim folderPath As String = FileShareFolderHelper.GetDataManagementExportUsernameFolderForApp(si, True, configSettings.FileShareRootFolder, si.AppName)
'define the full path including the file name
Dim filePath As String = folderPath & "\SomeFileNameFormsData.csv"
'next check if the file exists on the file share...
If File.Exists(filePath) Then
'define the source origin members
Dim sourceOrigins As New List(Of String)
sourceOrigins.Add("Forms")
'define target origin member
Dim targetOrigin As String = "Forms"
'process the file and load the data - do not load zeros
BRApi.Finance.Data.SetDataCellsUsingUsingCsvFile(si, filePath, ",", sourceOrigins, targetOrigin, False)
End If
Nick Kroppe
OneStream Software
12-23-2021 04:53 AM
Thanks Nick - all tested and works well!