Custom user profile fields accessing in widget

I had created a custom profile field  which was of type date. The value vary by Each user.

I need code to access that custom profile field value .

ex: DateofAppointment  is custom profile field .

Need to access the value through widget.can any one  help me.

Parents
  • You can access the profile fields on the user object $user.ProfileFields.  The following is an example of getting and setting the value using the widget api:

    #set ($user = $core_v2_user.Accessing)
    #set ($dateOfAppointment = $user.ProfileFields.get_item("DateOfAppointment").Value)
    
    #set($options = "%{}")
    $options.Add('_ProfileFields_DateOfAppointment', 'TestValue')
    $options.Add('Id', $user.Id)
    
    #set ($userResponse = $core_v2_user.Update($options))

Reply
  • You can access the profile fields on the user object $user.ProfileFields.  The following is an example of getting and setting the value using the widget api:

    #set ($user = $core_v2_user.Accessing)
    #set ($dateOfAppointment = $user.ProfileFields.get_item("DateOfAppointment").Value)
    
    #set($options = "%{}")
    $options.Add('_ProfileFields_DateOfAppointment', 'TestValue')
    $options.Add('Id', $user.Id)
    
    #set ($userResponse = $core_v2_user.Update($options))

Children