# How to pass unescaped JSON to Azure IoTHub?

**URL:** <https://community.particle.io/t/how-to-pass-unescaped-json-to-azure-iothub/28142>\
**Category:** Cloud\
**Created:** [December 26, 2016, 12:53am UTC](https://community.particle.io/t/how-to-pass-unescaped-json-to-azure-iothub/28142 "2016-12-26T00:53:11Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)\
**Post date:** [December 27, 2016, 10:58pm UTC](https://community.particle.io/t/how-to-pass-unescaped-json-to-azure-iothub/28142/8 "2016-12-27T22:58:59Z")

</div>

@Dave Can help clarify on the JSON string issues.

> [@svelde](#):
>
> Do you get separate table columns for all fields in your message or a single column named Data (filled with the escaped JSON string)?

Yes, I get separate table columns placed into the Azure Table storage and here is what my code and JSON Template look like to do that:

Here is the code I'm testing on a Photon:

```cpp

char Org[] = "My_ORGANIZATION";
char Disp[] = "Particle Photon";
char Locn[] = "Fishers, IN";

const char* cityLocation = "Fishers"; //City for my Photon
const char* stateLocation = "IN"; // State for my Photon

int SOC = 95;
float Voltage = 12.80;
float Current = 5.25;
float TTG = 35.4;
float Temperature = 81.3;
float SolarVin = 24.2;
float SolarVmp = 19.2;
float SolarW = 56.2;

// The on-board LED
int led = D7;

void setup() {
  pinMode(led, OUTPUT);
}
void loop() {

  char payload[255];
  // Turn the LED ON
 digitalWrite(led, HIGH);

  snprintf(payload, sizeof(payload), "{ \"s\": %d, \"v\": %.2f, \"i\": %.2f, \"t\": %.2f,\"f\": %.2f, \"s\": %.2f, \"m\": %.2f, \"w\": %.2f,\"l\":\"%s\" }", SOC, Voltage, Current, TTG, Temperature, SolarVin, SolarVmp, SolarW, Locn);
   //Serial.println(payload);
  // Spark.publish("AzureElectron", payload, NO_ACK); //The NO_ACK is currently only working with RC 0.6.0 rc1 firmware. This is just a test. For Electron
   Particle.publish("Azure_IOT_Almost", payload, PRIVATE);

  // Turn the LED off
  digitalWrite(led, LOW);
  delay(10000);
}

```

And here is how I have the Azure IoT Hub setup with custom JSON formatting to get the data fields into separate columns in Azure Table Storage:

 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/4/4293058927149714f8fbec8bd8805ef70297e528.png)

Then using this Azure Stream Analytics Query:

I get data in separate columns in the Azure Table Database:

 ![](https://community.particle.io/uploads/particle/original/2X/0/07983c73d6d6bb9d19454add2554cb569e512e78.png)

Does that help you any?

---

_[View the full topic](https://community.particle.io/t/how-to-pass-unescaped-json-to-azure-iothub/28142)._
