Determine Email of the person in the people field using JSOM or REST API
Hi,I have to build below HTML dynamically. The source to build this is a sharepoint list that has a people field in it.Can I use JSOM or REST API to do this? if so, can anyone help with some examples?<a href='mailto:[email protected],[email protected]'>Write email</a>
techie
Hi,
The following code for your reference:
<script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var array=new Array();
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('CustomList')/items?$select=EmployeeId";
// execute AJAX request
$.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
success: function (data) {
var dataResults = data.d.results;
for(var i=0;i<dataResults.length;i++){
if(dataResults[i].EmployeeId!=null){
for(var j=0;j<dataResults[i].EmployeeId.results.length;j++){
array.push(dataResults[i].EmployeeId.results[j]);
//remove the duplicated id
var employeeIds=$.unique(array);
//get the employee email by user id
var emails=getEmailsByIDs(employeeIds);
//add to send mail div
$("#SendMail").append("<a href='mailto:"+emails+"'>Send Email</a>");
error: function () {
//console.log("Failed to get details");
function getEmailsByIDs(employeeIds){
var emails=new Array();
var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/web/siteusers?$select=Id,Email";
// execute AJAX request
$.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
async: false,
success: function (data) {
var dataResults=data.d.results;
for(var i=0;i<dataResults.length;i++){
for(var j=0;j<employeeIds.length;j++){
if(dataResults[i].Id!=null&&dataResults[i].Id==employeeIds[j]&&dataResults[i].Email!=null){
emails.push(dataResults[i].Email);
error: function () {
//console.log("Failed to get details");
return emails;
</script>
<div id="SendMail">
</div>
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected].
Dennis Guo
TechNet Community Support
Similar Messages
-
Please Help. I received 4 emails from 1 person with the same message heading. The emails were automatically grouped Apple Mail. I replied to the latest mail in the conversation. Once sent the other messages in the conversation disappeared. I NEED THEM BACK! They all had very important attachments. I have tried looking for them in deleted items, even though I didn't throw any of them away, still cant find them. Never had this problem before. I'm pretty sure its a setting somewhere. Also tried expanding all conversations, no luck. Searching for the mails under the sent email address, no luck.
I'm sure they are not deleted but have somehow been hidden by Mail. Very frustrating.
Thanks in advance for any help.
Kash.I have found found out what has happened. I had requested a statement dating back to April 2012 from a supplier. They replied back with the latest statementof 2013 only but used the same subject heading as the previous monthly statements. Apple Mail automatically grouped these and I thought that they were sent altogether. As soon as I replied to the last email all other the previous emails ungrouped from the conversation leaving me lost as to where they had gone. They were all still sitting in my inbox but no longer part of the trcked conversation. I searched under the subject heading and all individual mails were all still there. (feeling stupid - )
-
How can I isolate iPad apps so only the ones I want people to use are visible to them?
Hello. How can I isolate iPad apps so only the ones I want people to use are visible to them?
At the moment it's not possible, but you could try providing feedback to Apple here http://www.apple.com/feedback/ipad.html (this has come up a few times so you won't be the first person to request it).
An alternative if you only want your customers to have access to only one app, is to look for cases that prevent access to the home button so that they can't get access to the home screen and therefore other apps. e.g. http://www.staypad.com/photos.html is a mounted case for use on walls/tables etc (there are probably others available, that is just the first one that my search found). -
Every time I make a call or I'm receiving a call my phone is extremely static i can't hear the person on the other line and the person on the other line cannot hear anything They say that they hear a lot of static now my videos when I play a video on YouTube for instance works just fine Siri works just fine. I can't make a call or receive a call whatsoever because all I hear is static and I haven't dropped the phone in water nothing has really happened this literally happened overnight
This is a wireless carrier issue. The fact that the speaker & microphone work properly for other apps is a great indicator that your device is fine.
Contact your wireless carrier about your call quality issue. -
When I make a call, I can hear the person on the other end but they can't hear me. It's not the mic bc face time or voice recorder are not affected. I can't even use my headphones or Bluetooth to get around the problem. This has stumped 2 geniuses, they just try to swap it out for $150.
I am having the same issue with my iPhone 4. I can hear everyone but they can't hear me. Visited Apple Store and they said speakers were out, both bottom mic and top one for speaker phone. Said they were busted. Reloaded all software and didn't work. Got in parking lot and worked for 1 call. Now it's out again. Wanted $150 for new phone, haven't done it yet. don't know what to do.
-
I have a iPhone 4 and all of a sudden when I answer a phone call the person on the other end can't hear me ???? I can hear them , so I've had to put it on speaker for all my calls - ? Any tips on how to get it back to being able to speak normally
Morning Lupoipia,
Thanks for using Apple Support Communities.
If you can't be heard by someone who is calling, take a look at this article:
iPhone: Can't hear through the receiver or speakers
http://support.apple.com/kb/TS1630
Best of luck,
Mario -
When I try to, the person on the other side can't hear me, and all I can hear are noises. But when I use apps like Viber or Facetime, I can make calls just fine! What may be the problem?
Did you fix the problem? I have the same problem and it has been pain in the neck.
-
It's been more than a week since I had this problem.
As I said I can mostly hear the person on the line but the person on the other line cannot hear my voice.
How can I fixed this problem? Do I have to go to the apple store? My warranty has expired and I can't get to the apple store easily becasue it's too far from where I live:( Please help.Does your iPhone say headphones when you adjust the volume, even when they are disconnected?
You can try disconnecting and reconnecting the headphones 5-6 times or restoring the iPhone.
If that doesn't do it, you can setup service for the iPhone online or have a Genius take a look at it. -
I frequently lose audio when in the middle of a call. I am not certain whether it is a full disconnect or just an audio loss. The person on the other end reports still being able to hear me, however, I suppose they could hear me speaking over another source even if bluetooth disconnected. The loss of audio is always preceded by a quick shrill noise, so I can easily tell when it happens. All I have to do to fix the problem is to select Audio Source on the call screen, temporarily switch audio back to the iPhone, and then switch back to the headset, and then it starts working again.
My Iphone5 was replaced and having same Problem. Only does this when using bluetooth for talking.I have the exact same issue... I've been using a Jabra Extreme2 and just this weekend, bought a Plantronics Marque2 and today had the same issue, so it's clearly not the headset but the phone or OS.
I might try a restore and see if it helps... -
Since I've done the ios6 update on my ipad2, when I FaceTime someone the person on the other end says all they hear is static and my voice very faintly. Anyone know how to fix this? Thank you.
Using FaceTime http://support.apple.com/kb/ht4319
Troubleshooting FaceTime http://support.apple.com/kb/TS3367
The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
http://tinyurl.com/32drz3d
I saw one post where a user said dust got inside the small microphone hole. Using a vacuum cleaner removed the dust and restored the audio.
Cheers, Tom -
I can barely hear the person on the other line, i tried resetting but it didnt work
I can barely hear the person on the other line, i tried resetting as suggested by other users but it didn't work. Help!!
Do you have a screen protector covering the speaker?
Have you powered the iPhone off and back on? -
How to blur the face of the person in the video using Adobe Premier Pro CS5
Hi
I have a video captured from a flipcam. I have Adobe Premier Pro CS5 and I don't have any knowledge of Adobe Premier Pro CS5 . Please can some one post a tutorial as how to blur the face of the person in the video using Adobe Master Collection CS5
Any help will be grateful .
ThanksYou are not really in the right place. I don't think you can edit video with Photoshop CS5, but Premier Pro CS5 can definitely do it. Off the top of my head, copy the video track on the timeline, (hold down the Alt/Opt key and drag).
Then Effects > Video Effects > Stylize > Mosaic.
Adjust number of blocks in Effects controls.
Then add Video effects > Keying > Four point matte
Adjust position of matte in effects controls.
If you want the matte to track with the video, move to start point on time line and adjust position. Move to end point and edit position. Matte will now move from one point to the other.
If you want more and better help, go to the Prem Pro forum. -
someone stole my ipad when i was in turkey for holiday!! is it possible to block my ipad so the person who stole it, cant use my ipad???
if you installed the find my iphone app on it you can disable it and or tack if
unless they restored it to factory settings
or if you didn't put a passcode on it and they deleted the app -
hello. I have purchased from a friend a iphone 4s
but iphone is closed by uncompte iCloud
I tried to contact the person of the old iphone but he also forgot his account iddentification nails please help me iWell, unless you can get this info, all you'll own is a paperweight. So, return the phone & get your money back. There is no other solution.
Apple can't/won't help you with this.
Good luck. -
I need help with my iPhone 5 I'm hearing perfectly but the person receiving the call is not hearing me at all. Can anyone help. Thanks
You can call your carrier for troubleshooting but ultimatly this is common with the Iphone 5 and you will end up needing a warranty replacement.
Maybe you are looking for
-
Facebook Notifications on Hub don't appear
I updated my Z10 recently with os 10.1. After the update, I noticed that Facebook notifications dont appear in the hub like they used to. I tried performing a system restore to the extent of losing all my contacts in full hope of it solving the probl
-
Greetings: I have a significant amount of home movies on my windows computer in AVI format. I want to save a copy of all AVI files. I also have Quicktime Pro. What is the most efficient (space saving with best resolution) way of playing the AVI mov
-
Can't view the applet in the browser
I have created an applet form using JDeveloper 3.1 to connect to the Oracle8i Rel2. However the following error appear during the connection: cannot instantiate class:oracle.jbo.common.jboInitialContextFactory Please assist.
-
UI Defaults in column properties
Hi ! At column level, there are UI Defaults properties (label, display as,...). Apart from the fact that they exist, does DM uses these properties? if so, in which feature ? Thanks regards Fabrice.
-
Make to order Scenario...any client level settings
Hi please guide me as there any settings which are at Client level or company code level..... shailesh