Updating Group Avatar with Velocity

I am trying to update a set of Groups' avatars with Velocity but its not working and I am getting a null return.

Here is what I am trying:

  $core_v2_utility.ToJson($core_v2_group.Update($group.Id, "%{ AvatarFileName =  '/cfs-file/__key/communityserver-components-groupavatars/00-00-00-05-85/image.jpg'} "))
                                   

Parents
  • I think the AvatarFileName value is used for passing in the file name when uploading a new file with the content and not to set an existing cfs file into a group

    I assume the file you are referencing is one from a set of existing images you want to reuse across groups dynamically, if not then you should be passing the filename and upload context for the newly uploaded file 

    If you have no other choice, you could update the extended attribute directly but this is risky as this could change in future releases

    Something like 

    #set($options = "%{}")
    $options.Add("_ExtendedAttributes_AvatarUrl", "~/cfs-file/......")
    #set($groupResponse = $core_v2_group.Update($group.Id, $options))



Reply
  • I think the AvatarFileName value is used for passing in the file name when uploading a new file with the content and not to set an existing cfs file into a group

    I assume the file you are referencing is one from a set of existing images you want to reuse across groups dynamically, if not then you should be passing the filename and upload context for the newly uploaded file 

    If you have no other choice, you could update the extended attribute directly but this is risky as this could change in future releases

    Something like 

    #set($options = "%{}")
    $options.Add("_ExtendedAttributes_AvatarUrl", "~/cfs-file/......")
    #set($groupResponse = $core_v2_group.Update($group.Id, $options))



Children