How do I create a JSON string from an Array?

Hi @rinki

You might want to look into ways of creating a Json object from scratch then, see here:

You will need to import this namespace: Newtonsoft.Json.Linq

Simple example. This code:

New JObject(
        New JProperty("key","value")
		).ToString

Will give you an actual JSON object you want, like so (here I just output it to console by using .ToString):

Additionally, if you want dynamic arrays, you can first create an array and then add an element to it by using Invoke Method activity like so:

(1) Create source Jarray (it can be nested inside the object, you would then just reference it with its path):

(2) Add an element to it with Invoke Method activity and that’s it :slight_smile:

1 Like