Update Library Functions

You can update an already created library with an updated Javascript file.

Note the following guidelines for updating a Javascript file:
  • Functions (within a library) used in integrations must be available in the updated Javascript file.
  • The signatures (parameters and function name) for these functions must remain intact to prevent runtime issues.
  • The addition of new functions is allowed.
  • Active integrations using new or updated functions must be reactivated.

The following changes make an updated Javascript file invalid:

  • Changing the name of a function being used in an integration.
  • Changing the parameter definitions of functions used in an integration.
  • Structural issues with the Javascript file.
  • The number of functions exceeds 500.
  1. In the left navigation pane, click Home > Integrations > Libraries.
  2. Find the library to update.
  3. Select Update from the Actions menu menu. For example, assume the library to update includes four functions, one of which (multiply) is currently being used in an integration.

    The content of the library is as follows:
    function add ( param1, param2 ) {
         var retValue = param1 + param2; 
         return retValue;
    }
    function subtract ( param1, param2 ) {
         var retValue = param1 - param2; 
         return retValue;
    }
    function multiply ( param1, param2 ) {
         var retValue = param1 * param2; 
         return retValue;
    }
    function divide ( param1, param2 ) {
         var retValue = param1 / param2; 
         return retValue;
    }
  4. Click Choose File to select the Javascript file that includes the function updates, then click Update.

    Update Function Dialog with Choose File button, Update button, and Cancel button

    For this example, the Javascript file consists of the following updates:
    • Two new functions: add_three, multiply_three
    • One removed function that was not being used by any integrations: subtract
    • A code change to the multiply function that is currently being used in an integration
    function add ( param1, param2 ) {
         var retValue = param1 + param2; 
         return retValue;
    }
    function multiply ( param1, param2 ) {
         var retValue = param1 * param2 * 2; 
         return retValue;
    }
    function divide ( param1, param2 ) {
         var retValue = param1 / param2; 
         return retValue;
    }
    function add_three ( param1, param2, param3 ) {
         var retValue = param1 + param2 + param3; 
         return retValue;
    }
    function multiply_three ( param1, param2, param3 ) {
         var retValue = param1 * param2 * param3; 
         return retValue;
    }

    All these updates are valid and the library is successfully updated. The library edit page is displayed with the updates. Any active integrations using the multiply function must be reactivated.



    An example of an invalid Javascript file that would not be successfully uploaded is if the multiply function included a parameter definition that changed (for example, param2 to param3).

    function add ( param1, param2 ) {
         var retValue = param1 + param2; 
         return retValue;
    }
    function multiply ( param1, param3 ) {
         var retValue = param1 * param2 * 2; 
         return retValue;
    }
    function divide ( param1, param3 ) {
         var retValue = param1 / param2; 
         return retValue;
    }