How can I update a user's EnableDisplayInMemberList using Velocity Script API, from within an automation?
How can I update a user's EnableDisplayInMemberList using Velocity Script API, from within an automation?
#set($useresponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = 1, Id = $userId }")
Here 1 represents True and 0 represents False
It doesn't seem to work. EnableDisplayInMemberList is not listed as one of the parameters that can be updated with $core_v2_user.Update() on the User Script API page, but is listed on the User REST API page. How do I use the REST API to update it from within an automation?
Did you passed the userid ?
Yes, I passed the userid.
But its working in my case
if i run below code
#set($user = $core_v2_user.Accessing) #set($useresponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = 0, Id = $user.Id }")) $useresponse
got the below result
and if i run this
#set($user = $core_v2_user.Accessing) #set($useresponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = 1, Id = $user.Id }")) $useresponse
got this as results
Okay, thanks for the information. It didn't seem to be working from my automation. I will try it again
After further testing, I can confirm that it does NOT work in my automation, when using following code:
#set($userId = $context_v2_automationTrigger.Arguments.UserId) #set($user = $core_v2_user.Get("%{ Id = $userId }")) #set($userResponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = 1, Id = $user.Id }"))
It's not an int, its a boolean value(true/false).
I have tried the following, and none of them work:
#set ($userResponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = false, Id = $user.Id }"))
and
#set ($userResponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = 'false', Id = $user.Id }"))
I have tried the following, and none of them work:
#set ($userResponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = false, Id = $user.Id }"))
and
#set ($userResponse = $core_v2_user.Update("%{ EnableDisplayInMemberList = 'false', Id = $user.Id }"))