none
Retrieve user details using JQuery/CSOM in SharePoint 2010 RRS feed

  • Question

  • Hi

    Please help me to retrieve data of a User (Email ID/ Chat option/ Employee ID/ Picture)

    whenever the user is entered in a people picker field, on a button click i want the data to be displayed, is there any way to do this in SharePoint 2010 using the client side code

    Thanks in advance

    Paru

    Friday, September 23, 2016 11:32 AM

Answers

  • Hi,

     

    Try this:

    <a href="sip:useralias@microsoft.com">chat</a>

    This is for Skype for Business.

     

    Best Regards,

    Lee


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Paru Upreti Tuesday, September 27, 2016 1:03 PM
    Tuesday, September 27, 2016 9:51 AM
  • Hi,

    Below is that I tested for your reference:

    <script>
                function update() {
                    var email='useralias@microsoft.com';
                    document.getElementById('emailIDChat').href = 'sip:' + email;
                }
                function Show() {
                    alert(document.getElementById('emailIDChat').href);
                }
            </script>
        <input type="button" id="update" onclick="update();"/>
        <a id="emailIDChat" onclick="Show();" href="">chat</a>

    Best Regards,

    Lee


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, September 28, 2016 1:19 AM

All replies

  • Hi,

    Based on my understanding, you want to display user properties somewhere when input user in people picker control in SharePoint 2010.

    You could reference below thread to trigger callback event for people picker control and then get other properties by second thread:

    https://social.msdn.microsoft.com/Forums/office/en-US/1f62459c-0ef8-4825-b438-b7aacad3999b/how-can-we-get-user-profile-details-on-people-picker-selection?forum=sharepointdevelopmentprevious

    Here is one thread about get user properties, you could try to follow the solution:

    http://sharepoint.stackexchange.com/questions/183527/how-to-access-custom-property-from-user-profile-using-jquery

    If this doesn’t provide help, could provide more details for your requirements.

    Best Regards,

    Lee


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, September 26, 2016 7:58 AM
  • Thanks a lot Lee this can help me..i will try these options and get back

    Paru

    Monday, September 26, 2016 1:43 PM
  • Hi Lee

    Thanks a lot the Email is working now, but i also want to open the Chat box (Skype) as shown in below image on click of a cat icon or EmailID,

    please help me how to accomplish the same using the CSOM in SharePoint 2010.

    Paru


    Paru

    Tuesday, September 27, 2016 8:39 AM
  • Hi,

     

    Try this:

    <a href="sip:useralias@microsoft.com">chat</a>

    This is for Skype for Business.

     

    Best Regards,

    Lee


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Paru Upreti Tuesday, September 27, 2016 1:03 PM
    Tuesday, September 27, 2016 9:51 AM
  • This works :)

    One more question, i regret that i am bugging you so much, but m a little naive in this, 

    below is part of my code i am not pasting the whole code, but i want to know how to pass email ID which is retrieved from sharepoint list in mailto and IM sip?

    <td id="userNametd"><a href="mailto: " id="emailID"></a></td>
    <td id="emailIDtd"><a href="IM:<sip: >" id="emailIDChat"></a></td>

    Below is the code :

    /////////////////////////////////////////////////////////

       

    while (enumerator.moveNext()) {   
          var listItem = enumerator.get_current();   

    userName =listItem.get_item('User').get_lookupValue();
    emailID = listItem.get_item('Email');

         }   

    document.getElementById('emailID').href = emailID;
    document.getElementById('emailIDChat').href = emailID;

      }   

    ///////////////////////////////////////////////Get user profile details 

    </script>

    <div>
    <table border="1">
    <tr>
    <td id="userNametd"><a href="mailto: " id="emailID"></a></td>
    <td id="emailIDtd"><a href="IM:<sip: >" id="emailIDChat"></a></td>
    </tr>
    </table>
    </div>

    Thanks

    Paru



    Paru

    Tuesday, September 27, 2016 1:08 PM
  • Hi,

    Below is that I tested for your reference:

    <script>
                function update() {
                    var email='useralias@microsoft.com';
                    document.getElementById('emailIDChat').href = 'sip:' + email;
                }
                function Show() {
                    alert(document.getElementById('emailIDChat').href);
                }
            </script>
        <input type="button" id="update" onclick="update();"/>
        <a id="emailIDChat" onclick="Show();" href="">chat</a>

    Best Regards,

    Lee


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, September 28, 2016 1:19 AM
  • Great ! this works :) 

    Thanks a alot


    Paru

    Wednesday, September 28, 2016 9:04 AM