Change Load method through connector code

Nelly
New Contributor

Hello everyone! Quick question. Does anybody know how to change the Load Method for a ProcessDataTable through the connector code? We have a dashboard where the user wants to choose the Load Method with a radio button. We are able to pass that parameter to the code and change the api.LoadMethod property to Append but the load still executes as Replace.

The above works if we change the load method directly in the WF, but not from the code

image (4).png

1 REPLY 1

RobbSalzmann
Valued Contributor

Your code here is hard-coded to set the load method to TransformLoadMethodTypes.Append on line 42.
Your Radio Button Group is tied to a Bound Parameter.  This is what is being updated by the user's selection.  Base your decision logic on that parameter, set the api.LoadMethod to the appropriate TransformLoadMethodTypes value.

RobbSalzmann_0-1683895679405.png

Something like this:

Dim strLoadMethod as String = BRApi.Dashboards.Parameters.GetLiteralParameterValue(si, False, args.PrimaryDashboard.WorkspaceID, "TestParameter")

api.LoadMethod = TransformLoadMethodTypes.Append
If(strLoadMethod.Equals("Replace"))Then
	api.LoadMethod = TransformLoadMethodTypes.Replace
EndIf