Look up a person’s User ID from their email address

Forums SPJS-Utility Look up a person’s User ID from their email address

Viewing 2 reply threads
  • Author
    Posts
    • #36511
      Ivan Wilson
      Participant

      Is there a way to get a person’s user id based on their email address?

      This is not for the logged on user, so I can’t use _spPageContext.userId.

      This is on a DFFS form. I’m using getFieldValue(“MyPersonField”) to get the email address. I’ve tried spjs.utility.userInfo(“person@company.com”), but that returns false.

      Any ideas?

      Ivan

    • #36512
      Alexander Bautz
      Keymaster

      Are you pulling the email address from a people picker field? – if so you can use this snippet:

      var user = spjs.utility.getFieldValue({"fin": "Your_people_picker_field_internal_nam", "key": "loginname"});
      var userInfo = spjs.utility.userInfo(user[0]);
      var id = userInfo.ID;
      

      Alexander

    • #36513
      Ivan Wilson
      Participant

      Thanks Alexander

Viewing 2 reply threads
  • You must be logged in to reply to this topic.