Join data from two JSON arrays

@ajr ,

Two options that I see.

First, use a JSON SQL query and join the two tables together using address=validator. Probably wrong syntax, but you get the point:

select r.amount, v.address, v.name from {{table1.result}} r
join {{table2.validators}} v on r.validator=v.address

If you can;t get this working the you may be stuck brute forcing it.

Write a js query (or transformer) that loops through each result in table 1. .find() matching address in table 2. Add the found name to table 1 and repeat.

1 Like