Can any of you suggest on how to save the SharePoint search result that is clicked from list of all search results?
Loading
Can any of you suggest on how to save the SharePoint search result that is clicked from list of all search results?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Nanddeep NachanRank #38 · 35.2K reputationPosted Jul 5, 2018, 12:43 AM EDT
Rohit Kumar11 reputationPosted Jul 5, 2018, 12:52 AM EDT
Nanddeep, Thanks for the link
It gives only the text searched by user.I need what search result user clicked i.e., with all metadata into list.
Nanddeep NachanRank #38 · 35.2K reputationPosted Jul 5, 2018, 12:56 AM EDT
Rohit Kumar11 reputationPosted Jul 5, 2018, 1:01 AM EDT
I need all the details metioned in screenshot to be saved to a custom list on click of Add button
var cusTitle = ctx.CurrentItem.Title; - here is the error
alert(cusTitle);
var clientContext;
var scriptbase = _spPageContextInfo.webServerRelativeUrl + "/_layouts/15/";
$.getScript(scriptbase + "SP.js", function () {
clientContext = SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle("Contents");
var itemCreateInfo = new SP.ListItemCreationInformation();
var oListItem = oList.addItem(itemCreateInfo);
//var cusTitle = $getItemValue(ctx, "Title");
});
}
Nanddeep NachanRank #38 · 35.2K reputationPosted Jul 5, 2018, 2:34 AM EDT