Hi Team,
I need to send a message to a Kafka topic that's used by another team. To do this, we're using a plugin that accepts messages(parameter) as text. The message I need to send is a dictionary in Appian, and I'm converting it into a JSON string using a!toJson(). so that the other team can parse it. However, the other team expects the dictionary to be enclosed in single quotes, like this: '{"a": "hello", "b": 1}'.
a!toJson().
'{"a": "hello", "b": 1}'
I have few questions:
Discussion posts and replies are publicly visible
The output format is only a visual we use to better understand the output of an expression. It has zero impact at execution time.
A JSON string is expected to be in single quotes ?!?!? Never heard of this, sounds weird, but it is what it is ...
toJson() returns a simple string. Now, you can wrap that string into any characters you want.
"'" & tojson(<YOUR_DICTIONARY>) & "'"
Stefan Helzle said:?!?!? Never heard of this, sounds weird, but it is what it is ...
I think the special characters in my questions appears different when you're viewing. Is that you're asking Stefan?
No. It is about the requirement "the other team expects the dictionary to be enclosed in single quotes".
Yeah, I'm also not sure why they are asking this. I'm going to try your suggestion, if they are not ok with that, I will suggest them to make changes from their end.