Skip to main content
Newcomer
December 21, 2021
Solved

Import Data Extracted via data Management using Extensibility Business Rule

  • December 21, 2021
  • 2 replies
  • 0 views

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

Best answer by NickKroppe

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

2 replies

OneStream Employee
December 22, 2021

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

WeiAuthor
Newcomer
December 23, 2021

Thanks Nick - all tested and works well!

Veteran
June 30, 2022

Hello,

We tried this, the rule executes fine, but we don't see any data in the destination scenario. Will you please share sample CSV file? DO you have to add any named range or so in the CSV file?

 

OneStream Employee
March 28, 2023

DanielWillis  I'm having the same issue.  I'm able to run the load but I don't see any data loaded to the cube using this method.  Did you figure out your issue and if so can you help me along?

 

Contributor
March 28, 2023

Hey Chris. No, unfortunately I put it in the too hard basket as it was more of a side thing at the time and haven't gotten back to it. Its definitely a function I'm keen to understand though.

Veteran
March 29, 2023

Hello,

I was able to load data using SetDataCellsUsingUsingCsvFile function. Followed the below mentioned steps:

1. Export source data using a DM step. This will generate a CSV file. The format of CSV file should not be changed for loading in destination application.

2. Segregate Forms and Import data manually or through a BR, this would create two CSV files say "SourceImport.csv" and "SourceForms.csv".

3. "SourceForms.csv" data can be loaded in destination scenario/application using the SetDataCellsUsingUsingCsvFile function.

4. "SourceImport.csv" would have to be loaded via the usual Import, Validate, Load step.

Hope this helps.