I have a stream analytics job that generates alarm messages on incoming data and sends them to the Message table where they get picked up by Twilio Text Message service.
Here's my Stream Analytics query:
case when max(lab_temp_alarm) = 1 or max(humidity_alarm) = 1
then concat('ALERT: Temperature or Humidity value over threshold',
'; Time: ', max(timestamp_cst), ' CST', <line break>,
'; Asset Name: ', asset_name, <line break>,
'; Node Name: ', node_name, <line break>,
'; Temperature: ', round(avg([temperature (F)]), 2), 'F', <line break>,
'; Humidity: ', round(avg(humidity), 2), '%')
else 'No alarms'
end as TextBody
I need to put line breaks between "Time", "Asset Name" and all other readings. In SQL I would use CHAR(13) but it's not supported in Stream Analytics.
I tried to put "\n", "\r\n", "x0a" and all other stuff but they're not converted into new line in the text messages that I receive during testing, they just remain what they are.
If there are line breaks in a message body in SQL so is there any alternative to CHAR(13) in Stream Analytics?