flatten structured values into json
walk through arrays by index