How to put variable in Json body in text file?

I have data in queue orchestrator.
Like:- in_TransactionItem.specificContent(“Number”) and store in variable.

And this same variable I need to put in json body like:

{
“jsonr”: “1.0”,
“method”: “abc”,
“param”: [
“0987654321” ---- here I need to put variable.
]
}

This json stored in text file.

So whenever we get data from queue it will put in this json body.

I had tried to put variable but not getting when trying to run this json.
CAn anyone help?

grafik
will result to a JObject - myJObject variable

grafik

So using an assign activity:
myJObject(“param”) = new JArray({YourVariable})

would set the value as demonstrated

This request body store in text file. like :- data.txt format not json format.

I have to take this entire data and put in “Body” in http request activity.

Sorry, didnt get you. Please elaborate more on it.

Kindly note:

  • we did read a text file
  • we parsed the textfile content into a JSON
  • we updated a prticular property (short summary)

what is common / different to your requested case?

Adding to what @ppr showed, instead of assign to a JArray, we can simply assign the value like below:

JObject(“param”)(0) = yourvariable

It doesnt matter if the data is in text format as long as the inside data in the text is in json format. Deserialize activity will be able to convert it to a JObject