Updating User Profile Field REST Endpoint

Former Member
Former Member

How do you update the user profile field REST endpoint with a name and value for a Single Select? This is what I currently have:

_saveCountry = function(context) {
	return $.telligent.evolution.put({
	    url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/userprofilefields/country.json',
	    data: { 
		    'name':  context.countryname,
		    'value': context.country
	    },
	    success: function(response) {

	    }
    });
		     
},

Parents
No Data
Reply Children
  • Former Member
    0 Former Member in reply to Former Member

    Here is an example adding 2 dynamically named fields to the data object.  You will just need to do the same with a loop adding all the dynamically named fields.

    var data = { IsSearchable: false };
    
    //loop start here
    var country = '_FieldTypeChoice_' + 'country1';
    data[country] = 'value1';
    
    country = '_FieldTypeChoice_' + 'country2';
    data[country] = 'value2';
    
    //loop end here
    
    
    console.log(data);