if (typeof msg.payload.ProgramNumber === "undefined") msg.payload.ProgramNumber = {"value":0};
if (typeof msg.payload.NumOfLeaks === "undefined") msg.payload.NumOfLeaks = {"value":0};
if (typeof msg.payload.FsFlow === "undefined") msg.payload.FsFlow = {"value":0};
if (typeof msg.payload.MsFlow === "undefined") msg.payload.MsFlow = {"value":0};
if (typeof msg.payload.Ds1Flow === "undefined") msg.payload.Ds1Flow = {"value":0};
if (typeof msg.payload.SpruFlow === "undefined") msg.payload.SpruFlow = {"value":0};
if (typeof msg.payload.Jc1Flow === "undefined") msg.payload.Jc1Flow = {"value":0};
if (typeof msg.payload.Jc2Flow === "undefined") msg.payload.Jc2Flow = {"value":0};
if (typeof msg.payload.Jc3Flow === "undefined") msg.payload.Jc3Flow = {"value":0};
if (typeof msg.payload.Jc4Flow === "undefined") msg.payload.Jc4Flow = {"value":0};
if (typeof msg.payload.FacFlow === "undefined") msg.payload.FacFlow = {"value":0};
if (typeof msg.payload.JcFlow === "undefined") msg.payload.JcFlow = {"value":0};
if (typeof msg.payload.FacPress === "undefined") msg.payload.FacPress = {"value":0};
if (typeof msg.payload.JcPress === "undefined") msg.payload.JcPress = {"value":0};
if (typeof msg.payload.Ds2Flow === "undefined") msg.payload.Ds2Flow = {"value":0};
msg.topic = `INSERT INTO SSreadings (ProgramNumber, NumOfLeaks, FsFlow, MsFlow, Ds1Flow, SpruFlow, Jc1Flow, Jc2Flow, Jc3Flow, Jc4Flow, FacFlow, JcFlow, FacPress, JcPress, Ds2Flow) VALUES (${msg.payload.ProgramNumber.value}, ${msg.payload.NumOfLeaks.value}, ${msg.payload.FsFlow.value}, ${msg.payload.MsFlow.value}, ${msg.payload.Ds1Flow.value}, ${msg.payload.SpruFlow.value}, ${msg.payload.Jc1Flow.value}, ${msg.payload.Jc2Flow.value}, ${msg.payload.Jc3Flow.value}, ${msg.payload.Jc4Flow.value}, ${msg.payload.FacFlow.value}, ${msg.payload.JcFlow.value}, ${msg.payload.FacPress.value}, ${msg.payload.JcPress.value}, ${msg.payload.Ds2Flow.value});`
return msg;
Everything seems to work using the above code. I am going to run it through the machines process and see if it works. I will Update this thread. Thanks for all the help, I appreciate it!