I have a value in local variable of ["12hg"] i need a output of "12hg" and this value is in the json message . Could anyone please help me on this and thanks for advance
Discussion posts and replies are publicly visible
To extract this value from JSON, first you need to parse the JSON using a!fromJson() to convert it into a dictionary. After that you can access the specific key to retrieve the value.
a!fromJson()
i need it inside the a!tojson function
I didn't get your point. From what I understood, you had a JSON input and you wanted to extract a value from it. Then why would you use a!toJson() ?
vemasani vishnu vardhan said:inside the a!tojson function
What do you mean by this exactly?
The string "["12hg"]" (or "[""12hg""]" in escape-quoted appian expression notation) is a valid JSON string containing the value "12hg". Passing it through a!fromJson() results in the value you're looking for. I'm not sure what other complication there is here. Your original JSON message would still be untouched, since that's how Appian variables work.
Yeah I think it would be helpful to provide a larger snippet of what your data looks like and tell us more about how you plan to use it. While there are a lot of functions that could probably achieve what you're looking for, if it's coming in JSON using a!fromJson() is usually your best bet