I want to generate an excel sheet using JSON to Excel converter plug in. Even though I am passing the json correctly, I am getting an error message:
Discussion posts and replies are publicly visible
Even if it might be confusing, the text box in which you enter your JSON is not meant to understand JSON. This is a SAIL language editor.
If you want to directly write JSON, then you need to wrap it in quotation marks. If you want to write it in Appian SAIL syntax, then you can use the toJson() function to turn it into JSON.
I suggest the second approach.
What's the full error text say? Your screenshot is too cramped to really tell, and it may also be truncated. Also, can you clarify what plug-in this is? I haven't seen this smart service before, and I'm actually rather interested in it.
yeah, sorry i didn't notice at first, he's definitely trying to save a plain dictionary (not json text) straight into a PV (presumably text type). Not sure why they'd expect that to work... JSON is a specific format, which he's completely skipping.
Error Message: Invalid Document com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 7 path $[1]See github.com/.../Troubleshooting.md
when I used to JSON, the below error is being displayed
error: Invalid Document java.lang.ClassCastException: class com.google.gson.JsonObject cannot be cast to class com.google.gson.JsonArray (com.google.gson.JsonObject and com.google.gson.JsonArray are in unnamed module of loader org.apache.felix.framework.BundleWiringImpl$BundleClassLoader @70181acf)
I would expect the smart service expects a JSON string representing an array. The JSON present in your PV looks like a single dictionary.
A valid JSON array will take a decidedly different format, and requires you to input an array (fwiw).
thanks - though that doesn't really show what plug-in it's from, i think I found it anyway - community.appian.com/.../json-to-excel-smart-plugin-converter
FYI as I mentioned in my earlier reply, this appears to work when the JSON you pass in is a valid array. Here's mine after passing it into an arbitrary pre-configured excel base template I already had sitting around in our Dev environment (with a "name" column and some other columns with irrelevant names). Note my JSON is an array of items, not a single dictionary. Also even though the smart service doesn't let you choose the starting column (just row), you can accomplish this by formatting the JSON such that the first column is left blank (just mentioning this since my templates mostly have a blank "spacer" column first).
thank you for your help, it is working now.