Select JavaScript libraries can be used in kBridge rules. The most important is the lodash library, which contains a large number of functions, methods, and calls.
Other available libraries, all of which call for the require() keyword, are as follows:
•axios
•docx-templates
•edge-js
•formulajs
•mssql
•mysql
•sqlite
•three.js
•xlsx
•xlsx-calc
•xml2js
_.uniq is a function that is contained in the Lodash library. It creates a duplicate-free version of an array, using the JavaScript SameValueZero algorithm for equality comparisons, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array.
You can view the Lodash library with this link: https://lodash.com/docs/4.17.15
You can also reference the Lodash library through the ExternalLibraries project.
Here is how to use the ExternalLibraries project.
Project Example:
In your kBridge Examples Projects folder, open the project called ‘ExternalLibraries.
Press the Run Custom UI icon to start the User Interface.
On the right are the different Methods from the Lodash library. Note that you must declare the Underscore variable in your statement.
Example:
const _ = require("lodash"); |
return _.difference([2, 1], [2, 3]); |
// => [1] |
When you make a selection from the UIDropdown menu a link will appear.
Click on the link and you will be directed to the method that you selected.