For a reason I believe to be a variable type issue between SensorName column in sql (which is setup as a varchar(max = 100) and data.sensor_name type. When I replace {{{data.sensor_name}}} with ‘testing’ I have no issues. So it does take a string value, just not from data.sensor_name.
Do I need to convert the json string value in data.sensor_name to a varchar? If so what is the easiest way to do that?
INSERT INTO [temperaturehumidity] (temp,humidity,nodeID,voltage,SensorName) VALUES ({{{payload.temperature}}}*1.8+32,{{{payload.humidity}}},{{{data.nodeId}}},{{{data.battery}}},{{{data.sensor_name}}})
Flow:
[{"id":"24a7e6c1.bbd94a","type":"ncd-wireless-node","z":"a41e8b1b.0dadc","name":"Room 1 Encapsulation Sensor (Semi)","connection":"99bc8983.06925","config_comm":"99bc8983.06925","addr":"00:13:a2:00:41:a3:d1:cd","sensor_type":"1","auto_config":true,"node_id":0,"delay":"300","destination":"0000FFFF","power":4,"retries":10,"pan_id":"7FFF","change_enabled":"","change_pr":"0","change_interval":"0","cm_calibration":"60.6","bp_altitude":"0","bp_pressure":"0","bp_temp_prec":"0","bp_press_prec":"0","amgt_accel":"0","amgt_mag":"0","amgt_gyro":"0","impact_accel":"0","impact_data_rate":"4","impact_threshold":25,"impact_duration":1,"activ_interr_x":1,"activ_interr_y":2,"activ_interr_z":4,"activ_interr_op":8,"filtering":0,"data_rate":5,"time_series":0,"reading_type":1,"x":300,"y":300,"wires":[["df6ab3eb.c0147","93e2f5e.0e0a108","6b76aa4d.37758c","86b55769.fca548","febbac70.a19a2"]]},{"id":"86b55769.fca548","type":"MSSQL","z":"a41e8b1b.0dadc","mssqlCN":"48d548c2.d378f","name":"MSSQL","query":"INSERT INTO [temperaturehumidity] (temp,humidity,nodeID,voltage,SensorName) VALUES ({{{payload.temperature}}}*1.8+32,{{{payload.humidity}}},{{{data.nodeId}}},{{{data.battery}}},'again a test')","outField":"payload","returnType":"0","throwErrors":"0","x":840,"y":300,"wires":[[]]},{"id":"99bc8983.06925","type":"ncd-gateway-config","z":"","name":"Wireless Modem","comm_type":"tcp","ip_address":"sanitized","tcp_port":"sanitized","port":"","baudRate":"115200","pan_id":"7FFF","rssi":false},{"id":"48d548c2.d378f","type":"MSSQL-CN","z":"","tdsVersion":"7_4","name":"sanitized","server":"sanitized","port":"1433","encyption":false,"database":"EnvironmentMonitoring","useUTC":true,"connectTimeout":"15000","requestTimeout":"15000","cancelTimeout":"5000","pool":"5"}]