Question
Combining specific results from two info tables to another infotables
I am needing to combine two Info-tables and display certain information from those on another info-table. I keep getting the error "Error executing service GetSalesOrderPartStyleProduct. Message :: Unable to Execute Union: Field [Customer] was not found in both infotables - See Script Error Log for more details." I understand what it means but cannot figure out where I am going wrong in my code. I created my service which has an info-table output. My thought was switching "Union" to "Join"
var params = {
infoTableName : "InfoTable",
dataShapeName : "TrainingDataShape_COB"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(TrainingDataShape_COB)
var myInfoTable = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
//// result: Two info tables given
var itPartInfo = Things["Training.InfoTable.PartInfo"].GetDataTableEntries(params);
var itOrderInfo = Things["Training.InfoTable.OrderInfo"].GetDataTableEntries(params);
var query = {
filters: {
"fieldName":"Color",
"type": "EQ",
"value": "Orange"
}
};
var params1 = {
t1: itOrderInfo /* INFOTABLE */,
t2: itPartInfo /* INFOTABLE */
};
// result: INFOTABLE
var result = Resources["InfoTableFunctions"].Union(params1)
var orange = Resources["InfoTableFunctions"].Combine({
t: myInfoTable,
columns: "OrderLineID",
columns: "SalesOrder",
columns: "PartID",
columns: "Style",
columns: "ProductCode",
count: undefined,
});
var result = Resources["InfoTableFunctions"].DeriveFields(orange)

