How can I create a lookup field to the userRole object

I’ve gotten this far, but some pointers would be appreciated. Please don’t give me the solution though. Going to the “else” bit now as I know how to do this part.

var field = arguments[0], value = skuid.utils.decodeHTML(arguments[1]), userRoleModel = skuid.$M('UserRoles'); if (field.mode == 'edit') { // lookup values in userRole in order to display then in a picklist } else { // find the Name of the userRole based on the value in the text field called Role and display name }