Upsert with multiple UIDs

Thanks for the help. You were right about the need to remove those first two lines.
Now when I run the upsert, it throws the exception:
Some variables are used but not defined

What does that mean?
I’m wondering if there’s some sort of conflict between:
productsUid : uid
and productsUid as uid in the two parts of my query; however, in the bottom part of the query (the getVals part), I’m not sure how to get the UID of the products node in a way that will allow me to get it back out of the query in a uidMap. (I need to pass the UIDs to another function that will perform additional Dgraph operations after completing the upsert.)

Regarding @normalize, here’s what I get with it:

And, here’s what I get without it:

You can see that the output is identical and is not flat in either.