Skip to content

How could I exclude null values from an GetArrayValues query? #290

Discussion options

You must be logged in to vote

Although my code worked initially, when I reloaded the patch it failed due to a null array error. I discovered that the push of the filtered arrays to the outputs needs to be inside the function. The corrected code is:

//Create input and output ports and intialize them

const arrayIn_1 = op.inArray("Array in 1");
const arrayIn_2 = op.inArray("Array in 2");
const arrayOut_1 = op.outArray("Array out 1");
const arrayOut_2 = op.outArray("Array out 2");

//Create filter arrays
const arr1_filtered = [];
const arr2_filtered = [];

//Filtering function
arrayIn_1.onChange=arrayIn_2.onChange=function()
{
    console.log("Filtering...");
    //Assign the input arrays to local arrays
    var arr1 = a…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@steam0r
Comment options

@ianww
Comment options

@ianww
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ianww
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants