Cross-index data from multiple files

Is there a good way to cross-reference data from multiple data files in Hugo?

I’m bringing in a data file from externally, so i can’t edit that, but I have my own source where I’m defining names based off id numbers.

Source data file (example record):

{
    "list":[
        {
            "nameId":"1610612761"
        }
    ]
}

Supplemental data file:

{
    "names": [
        {
            "nameId": "1610612761",
            "name": "Fred"
        }
    ]
}

My hugo template so far:

{{ range $index, $element := .Site.Data.source.list }}
{{ $element.nameId }}
{{ end }}

That works to display the nameId, of course. But how do I index that with my supplemental data file to replace the id with the string name? index is probably the answer somehow, but I can’t wrap my mind around how it might work, perhaps in conjunction with a nested range?

See this solution from a previous discussion, it may be useful to you.

Here’s what I ended up using as a solution to this:

{{ range $index, $element := .Site.Data.source.list }}
{{ $value := index .Site.Data.supplemental.names $element.nameId }}
{{ $value.name }}
{{ end }}

And it ended up being much simpler than I thought it might be.