0

I am having a requirement to get a Contact Button on home page that having a functionality, when we click on the button, New email tab opens with email id Example@gmail.com. We should change the email ID Without changing the code.

I created a List and Inter a email id in Title and try to retrieve the email id from REST API, But it didn't work for me. Below is the code I have used in the new page with Script Editor WebPart

https://XYZ.sharepoint.com/sites/ABC/_api/web/lists/getByTitle('email')/items?$select=Title&$filter=ID eq 2'" />

  • Are you getting any error message? Check in console and let me know. – Rohit Waghela May 2 '18 at 6:31
1

Are you using the https://XYZ.sharepoint.com/sites/ABC/_api/web/lists/getByTitle('email')/items?$select=Title&$filter=ID eq 2 REST API as the attribute value of the Contact element?

You need to get the title using the REST API firstly, then use its value as the attribute value.

Information about how to retrieve SharePoint List Items Using Rest API

To return items from a list using JavaScript, we can also use the getItemById(id) function to return a single item, or use the getItems(query) function to return multiple items.

SharePoint Online: Retrieve list items from SharePoint list using JavaScript Object Model (JSOM)

SharePoint Online List methods

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.