JSON Payload being to sent to Hermes Kafka from ServiceNow is not in correct format

Community Alums
Not applicable

Hi All,

 

I have used a flow which is using payload builder to build JSON Payload and send the payload as a message to Hermes Kafka using OOTB Kafka Message Producer Step, the JSON Payload is like this:

 

{
"parent": "",
"caused_by": "",
"u_outage_start_date": "",
"watch_list": ""
}

 

Here if you can see watch_list is enclosed within double-quotes and it's value which is empty is "" but upon being sent to Hermes Topic the payload is changing to this format:

 

{
parent: ,
caused_by: ,
u_outage_start_date: ,
watch_list: 
} Here if you see there are no double quotes as in the previous payload can someone please tell me why this is happening at hermes end?

1 ACCEPTED SOLUTION

Hi @Community Alums ,

Double quotes are seemingly removed from string values in JSON payloads, may be related to the way the payload is processed or interpreted at different stages of your integration flow to hermes.

Please mark it helpful and solution proposed if it serves your purpose.

Thanks,

Anand

View solution in original post

4 REPLIES 4

Anand Kumar P
Giga Patron
Giga Patron

Hi @Community Alums ,

Try to convert object to a string and then send to hermas

var payload = {
  "parent": "",
  "caused_by": "",
  "u_outage_start_date": "",
  "watch_list": ""
};

// Convert the JavaScript object to a JSON string
var jsonStringPayload = JSON.stringify(payload);

Thanks,

Anand

Community Alums
Not applicable

Hi Anand,

 

but any reason why double quotes- may get removed at Hermes end?

 

Thanks,

Hrithik

Hi @Community Alums ,

Double quotes are seemingly removed from string values in JSON payloads, may be related to the way the payload is processed or interpreted at different stages of your integration flow to hermes.

Please mark it helpful and solution proposed if it serves your purpose.

Thanks,

Anand

Community Alums
Not applicable

Thanks @Anand Kumar P