It's all about the answers!

Ask a question

How do I set a Contributor attribute from a Javascript based Calculated Value?

Henrik J├Ânsson (1537) | asked Jan 16 '15, 7:29 a.m.
 I need to set a Contributor (e.g. Owner) in Javascript. Somehow I guess that I need to get the user id. How can I find that from a given username?

Jonas Studer commented Jan 16 '15, 7:43 a.m.

I've built my own user-management to do such things...

Get the users through this script

Use this method to do so:
function getMembersPaged(args, responseHandler){

Then parse throught the loaded datas..

Or the second and mybe better solution, is to load them via REST-Calls
There you could set the params you'll need.
Those scripts I suggested first are not open and not declared in the API

One answer

permanent link
Ralph Schoon (62.9k33645) | answered Jan 19 '15, 4:24 a.m.
You can not find the User ID from a given user name in a JavaScript attribute customization. You can print the ID and then put it into a script. See Lab 5 for more explanations and examples. See for how to use Java instead, where you have more access to complex items.

Your answer

Register or to post your answer.