How to reference the relationship variable when loading from csv?

Loading a CSV with dynamic columns is not something you can do with Cypher alone. IMO, manually curate a list of all the CSV formats you'll be loading, and create a different Cypher command for each of them. It may seem like more work now, but you'll thank me later.

Baring that, next best alternative would be to write your own procedure. Fair warning, it's tricky, but worth it. You'll probably end up spending 10x more time writing the procedure, than just tweaking 10 or 20 Cypher commands.