Sign In Register

How can we help you today?

Start a new topic
Answered

How to change displayName with cloud script ?

I tried


Spark.sendRequest({"@class": ".LogEventRequest", "eventKey": "changeUserDetailRequest", "displayName": "Bill123"});


but it does not work, changeUserDetailRequest is not triggered.


Is there another way ?


Best Answer

Hi Eric,


It looks like you're trying to send that as if it was a custom event. The correct way to do this in Cloud Code would be with the following.


var request = new SparkRequests.ChangeUserDetailsRequest();
    request.displayName = "newDisplayName";
    var response = request.Send();

 

You can reference the Client API here when you are sending requests in Cloud Code.


Thanks,

Liam


try changeUserDetailsRequest

you misspelled the event name

Answer

Hi Eric,


It looks like you're trying to send that as if it was a custom event. The correct way to do this in Cloud Code would be with the following.


var request = new SparkRequests.ChangeUserDetailsRequest();
    request.displayName = "newDisplayName";
    var response = request.Send();

 

You can reference the Client API here when you are sending requests in Cloud Code.


Thanks,

Liam

Great Liam, thanks a lot !

Login to post a comment