0

I have a SharePoint List from List API and trying to pull in some info about user from Delve. All the steps needed before my output is fine which includes things like fetch, looping, array objects etc. The bit that I need help with is the following and seems an syntax issue. This works as a stand alone URL <br />Regional Manager Email: <a href="https://tenantname-my.sharepoint.com/_layouts/15/me.aspx/?p=email@company.com&v=work">{item.regionalManagerEmail}</a> as well as this https://eur.delve.office.com/mt/v3/people/profileimage?userId=john.doe%40site.com&size=S for pulling in the picture. But how would I pull these in my application?

So in short I want to pull an email address and/or profile picture from my List {item.regionalManagerEmail} and append these to my output URL or how do I stringify it so it can go in the A Href in between 'https://tenantname-my.sharepoint.com/_layouts/15/me.aspx/?p=' + AND + '&v=work'? Current I am doing the following:

{standardAZListA.map((item, i) =>
              <TableRow key={i} value={item}>
                <TableRowColumn>
                               <MdHome size={30} />{item.value}, <br />{item.title}, 
                                  <br /> {item.value} 
                                  <br /> {item.telephone} 
                                  <br />Regional Manager:{item.regionalManager}
                                  <br />Regional Tel Number: {item.regionalManagerPhone}
                                  <br />Regional Manager Email: <a href="https://mysite-my.sharepoint.com/_layouts/15/me.aspx/?p=#Email&v=work">{item.regionalManagerEmail}</a>
)}  

Enviro is: ReactJS, Sharepoint Online Web Parts, Office 365.

  • "Delve profile from SharePoint from list?" - I am not sure I understand this. Since Delve works alone, so to say; and is a separate app from Microsoft included in the Office 365 pack. – JohnKelheim Feb 1 '18 at 12:49
  • Yes sorry for confusion. My List is in Sharepoint. Each list has an email address. For every email address returned take the value i.e. email@address.com and append it to the HRef so in effect what will happen on the front end is the web part will have email addresses as hyperlinks which when clicked on go to the Delve profile. Does that clear it up better? – KidKode Feb 1 '18 at 12:57
  • I believe it's a Concat issue actually. – KidKode Feb 1 '18 at 12:57
0

Fixed it before close of play wohoo! ;-):

  1. I took my mapping of List outside of the Return() so I add functions and loops

  2. Then Concatenated the URL to hit plus the stripped out email field

  3. The href now looks like this: <a href={urlTohit}>{item.regionalManagerEmail}</a>
  4. Finally in the Return() just added back in my formatted List in the Table like so: <TableBody>{list}</TableBody>

  5. Final code is:

    let list = standardAZListA.map(function(item, i) {

    if(item.title != null && item.title.length > 0){

    var myEmail = item.regionalManagerEmail; var urlTohit = 'https://mysite-my.sharepoint.com/_layouts/15/me.aspx/?p=' + myEmail;

      return   <TableRow key={i} value={item}>
      <TableRowColumn>
                     <MdHome size={30} />{item.value}, <br />{item.title}, 
                        <br /> {item.value} 
                        <br /> {item.telephone} 
                        <br />Customer Number{item.category}
                        <br />Email: <a href={urlTohit}>{item.regionalManagerEmail}</a>
                        <br />Opening Hours
                        <br />Regional Manager:{item.regionalManager}
                        <br />Regional Tel Number: {item.regionalManagerPhone}
                        <br />Regional Manager Email: {item.regionalManagerEmail}
                        <br />Area Manager: {item.VisitorServicesManager}
                        <br />Area Manager Tel Number: {item.VisitorServicesManagerPhone}
                        <br />Area Manager Email: {item.VisitorServicesManagerEmail}
                        <br />Assistant Manager: {item.VisitorServicesTeamLead}
                        <br />Assistant Manager Tel Number: {item.VisitorServicesTeamLeadPhone}
                        <br />Assistant Manager Email: {item.VisitorServicesTeamLeadEmail}
    
      </TableRowColumn>
    </TableRow>;        
    

    } }.bind(this));`

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.