You should be able to use “i” directly in the formula as below:
wg(gv(test), json, “.[0].genres.[” + i + "])
This should return Suspense, Drama. You can then use tc with split to split it.
An alternative with more control could be to use flows to manage this.
Currently Kustom json parser does not return json, i need to add a new option like a raw mode that will return json again so it can be parsed multiple times, especially in flows this is useful.
EDIT next version will return [Suspense, Drama] if you use .[0].genres.[*]
Sorry, I am kind of new at this. How should the formula be written exactly?
And how should I go about this using “flows” ? Especially when there are multiple arrays that need to be made into the same format as what I’m trying to achieve?
This will replace square brackets and " (char 22) with an empty string from the json output (which is [“Crime”, “Drama”, “Thriller”]) and should return “Crime,Drama,Thriller”
Correctly returns A,B,C (tested). There is a bug in the parser that will not accept a regexp trying to use double quotes, this messes up the expression tokenizer BUT you can use \x22 instead which is basically “ASCII char 22”, this will work.
Future version of the JSON parser might introduce the “join()” function, right now its not there. This requires latest 3.74 to work since in 3.73 json parser was not returning arrays and tc(json) was not there.