UI Dropdown - get result from SQL

Based on the screenshot of the data you have in this post - UI Dropdown - get result from SQL

You can either use a Function node with:

msg.options = msg.payload.map(function(value) {
    var v = {};
    v[value.location] = value.id;
    return v;
})
return msg;

Or a Change node, configured to "Set msg.options to the expression: $.payload.{location:id}