union of two infotables causing "null point exception"
Hi all,
I'm trying to union two infotables in my service but get a "Wrapped java.lang.NullPointerException Cause: null" error when I do. In my service I want to run a single query a variable number of times with a changes in 1 input parameter and then union them together. I do not seem to be able to do it. The infotable columns are exactly the same since the results are coming from the same query. I have it in a forloop so that I can append it a few times depending on how many instrument types the user selects.
How do I get this to work?
thanks!

code below:
var rawData1;
var rawDataA; var rawDataB;
var instrumentType;
for each (var row in InstrumentTypes.rows){
instrumentType = row.StringField;
var instrumentType1;
switch(instrumentType){
case "1":
instrumentType1 = "A"
var params = {
StartDate: sdate /* DATE */,
EndDate: edate /* DATE */,
ShowExternalRunsOnly: showExternalRuns /* BOOLEAN */,
InstrumentType1: instrumentType1 /*STRING*/,
};
rawDataA = Things["RedShiftDatabase"].CustomQueryAllPlatformsDataQueryv3(params);
break;
case "2":
instrumentType1 = "B"
logger.error("instrumentType1: " + instrumentType1);
var params = {
StartDate: sdate /* DATE */,
EndDate: edate /* DATE */,
ShowExternalRunsOnly: showExternalRuns /* BOOLEAN */,
InstrumentType1: instrumentType1 /*STRING*/,
};
rawDataA = Things["RedShiftDatabase"].CustomQueryAllPlatformsDataQueryv3(params);
break;
}
// Union tables from switch *UNION NOT WORKING FROM DIFFERENT INFOTABLES*
var params = {
t1: rawData1, // INFOTABLE
t2: rawDataA // INFOTABLE
};
// result: INFOTABLE
rawData1 = Resources["InfoTableFunctions"].Union(params);
}
}

