Forum Discussion

Nelly's avatar
Nelly
New Contributor
2 years ago

Change Load method through connector code

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

  • RobbSalzmann's avatar
    RobbSalzmann
    Valued Contributor II

    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.

    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