New answers tagged

1

You don't need to use the REST API to get the current user's display name or email address. You can get them from a JavaScript variable named _spPageContextInfo that is injected into each Classic SharePoint page. Use _spPageContextInfo.userDisplayName to get the currect user's name and _spPageContextInfo.userEmail to get their email address. You can get lots ...


0

You need to use the Email only. No need to use User/EMail. Try below. // Get current user jQuery.ajax({ url: "https://.../_api/web/currentuser?$select=Title,Email", type: "GET", headers: {"Accept": "application/json;odata=verbose","Content-Type": "application/json;odata=verbose"}, ...


0

If you want to retrieve email by REST API in the way as you posted you can simply change url parameter to https://.../_api/web/currentuser?$select=Title,Email So your code will be // Get current user jQuery.ajax({ url: "https://.../_api/web/currentuser?$select=Title,Email", type: "GET", headers: {"Accept": "...


0

Ok, based on your answers to some of my questions in the comments, here is how you find the correct integer ID to use when trying to set a lookup column using the REST API. You said that the lookup column you are trying to set looks at the list UlkeList. In order to set the lookup column, you need to know the list item ID of the specific item you want to ...


0

Are you talking below metadata? If so, you can maunally create an item through UI then query it via rest api, it will return the type info: BR


0

NO,you can't upload file and set column value in one request. Similar issue for your reference: REST post with metadata column? https://stackoverflow.com/questions/45175323/sharepoint-2013-online-can-i-set-other-column-values-when-uploading-a-file-using


0

Thank you Amos, But I found a simpler solution. I just added &selectproperties=CreatedBy to my URL Query string. Thank you anyway, your answer was helpful.


1

The created by column's internal name in SharePoint is Author. The users in Author shoule be the user who create the file and who upload the file to SharePoint. You could remap the create by column. The XML schema for the Core Results Web Part (http://msdn.microsoft.com/en-us/library/ms560074(v=office.12).aspx). NOTE: There are some errors in this MSDN ...


0

Just to keep an extra piece of information, since I can't add comments yet. Here is a guide I have followed, which unfortunately though throws an error at some point due to mismatch between the JSON and the scheme. [https://www.intelogy.co.uk/blog/assigning-microsoft-flow-approvals-to-sharepoint-groups/][1] I think this can be solved by retrieving the JSON ...


1

While the OP asks specifically for a REST or JSOM approach, there is another JavaScript option (which wraps the REST API anyway) using PNPJS and is compatible with SP Online. Adding this answer for completeness. await sp.web.lists.getByTitle("My List").update({ ReadSecurity: 2, WriteSecurity: 2 } as IListInfo); //Sets to only allow users to set and ...


Top 50 recent answers are included