User Profile Spacing

Forums Requests User Profile Spacing

Tagged: 

Viewing 1 reply thread
  • Author
    Posts
    • #27734
      Tricia S.
      Participant

      Hi,

      Could the spjs.utility.userProfile(); be updated to list the multivalue items rather than concatenate?
      We have some requests to use some of these fields. Trying to separate is near to impossible as capitalization are not predictable.
      I have included what I think is going on it seems to be removing pipes rather than replacing them with semicolons.

      Please and thank you.

    • #27746
      Alexander Bautz
      Keymaster

      Hi,
      The spjs.utility.userProfile function doesn’t really strip away or do anything with the values, but it is using the old userprofileservice.asmx and not REST so you might not get the same format on the output as with REST. How did you query to get the content in the first screenshot?

      You can try this function to get it with REST (only current users profile in this example):

      function getCurrenUserProfileREST() {
          var d = jQuery.Deferred();
          jQuery.ajax({
              "url": _spPageContextInfo.siteAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties",
              "method": "GET",
              "headers": { "Accept": "application/json;odata=verbose" },
              "success": function (data) {
                  console.log(data);
                  var r = {};
                  jQuery.each(data.d.UserProfileProperties.results, function (i, o) {
                      r[o.Key] = o.Value;
                  });
                  d.resolve(r);
              },
              "error": function (error) {
                  d.reject(error);
              }
          });
          return d.promise();
      }

      Use it like this:

      getCurrenUserProfileREST().done(function (data) {
          console.log(data);
      });

      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.