14 votes

SharePoint 2013 REST-API: Reliable way to retrieve all field values of a list item?

How about a simple query: /_api/web/lists/getbytitle('<list title>')/items(<item id>) which will return all the field values for a list item with some limitation for User/Lookup fields: ...
user avatar
14 votes

How to get listitem counts via rest api

You could use the rest API below as mentioned. /_api/web/lists/getbytitle('<list title>')/ItemCount You will get item count of any list or library you have one more option to retrieve both ...
user avatar
13 votes
Accepted

How to get the selected items of list in the javascript

Here is a basic example of how to get the selected items with javascript: var items = SP.ListOperation.Selection.getSelectedItems(); var myItems = ''; var i; myItems = items.map(function (v) { ...
user avatar
10 votes

Get all items from a folder using REST

Try to use this endpoint GetFolderByServerRelativeUrl to return all files and folder at a specific folder URL https://server/_api/Web/GetFolderByServerRelativeUrl(<folder url>)?$expand=Folders,...
user avatar
9 votes

Get Current list item

_spPageContextInfo Object could be used for retrieving information about current page on the client side, specifically pageListId property returns the current List Id. List Item Id could be extracted ...
user avatar
9 votes
Accepted

Best practice to add list item in SharePoint Server OM?

AllowUnsafeUpdates=true; is not required to add/delete/update list items unless you are doing these operations in Page_Load or other Get methods. Both CASE 1 and CASE 2 does not look good in terms of ...
user avatar
  • 8,759
7 votes

Delete ListItem after 7 days

Refer following steps to set Retention / Information management policy : Goto list settings click on Information management policy settings click on Item content type tick on Enable retention check ...
user avatar
5 votes
Accepted

Updating a single list item based on relative URL

You could perform this via CSOM/REST API. Use SP.Web.getFileByServerRelativeUrl Method to request File object and specify SP.File.listItemAllFields property to load list item field values for the ...
user avatar
5 votes
Accepted

Add facebook like button to sharepoint list item

You can add OOTB SharePoint rating to a list. Go to the list > list settings > rating settings. Set "Allow items in this list to be rated?" to Yes and choose between having "Likes" or "Star ratings"....
user avatar
  • 9,491
5 votes
Accepted

Upload list item attachment using JSOM

Most probably the error File not found occurs since you are trying to retrieve attachments folder that not yet exist in method HasListItemAttachment The following example demonstrates how to upload ...
user avatar
5 votes
Accepted

Limit only one entry per day per user in sharepoint list

Note: Since june 2017 this answer no longer applies for SharePoint versions; Microsoft disabled the use of JavaScript in a Calculated Columns For long explanation and work arounds see: June 13th ...
user avatar
5 votes
Accepted

How to add list item inside a folder using REST API

The REST API does not have complete support for folders - particularly when it comes to working with list items. While it's quite possible that there is a way to get this to work using the REST API, ...
user avatar
  • 11.5k
5 votes
Accepted

SP13 - How to sync 4000 items in list to target list

As per the documentation by Microsoft, you cannot select more than 100 items for bulk operations. The documentation says that: Where Boundary means you cannot configure the value. Its hard coded.
user avatar
5 votes

How to get listitem counts via rest api

It is better to use: "/_api/web/lists/getbytitle('<list title>')/ItemCount" instead of: "/_api/Web/Lists/GetByTitle('<list title>')/Items" because "/ItemCount" is faster with quick ...
user avatar
4 votes

Create Page using REST API

James your answer got me to look at it differently. If you want to create pages with the rest service I recommend you do the following. Create a page in the SharePoint site. Then download the page ...
user avatar
4 votes

Updating a list item using date() function

You can make use of JavaScript Date Object for that. For example, while reading the data var scheduledTime = new Date(oListItem["ScheduledTime"]); Now you can calculate the new Time as follows ...
user avatar
  • 28.2k
4 votes

How to move list item into folder in Sharepoint online

Example: how to move list item into a folder via SharePoint JSOM API /** * Move ListItem * @param {SP.ListItem} list item * @param {string} targetFolderUrl - server relative url of folder where ...
user avatar
4 votes

Update SharePoint item using Microsoft Flow?

MS Flow doesnt seem to allow you accomplish this at the moment - I came across this scenario as well. You may be able to do it if you set up your flow using the Logic Apps in Azure https://azure....
user avatar
  • 1,765
4 votes

Can list items have sub-items

An easy way for this is to create Parent items as Folder instead of item. You can create a custom Parent content type inheriting from Folder content type. Inside that Parent items , you can add your ...
user avatar
  • 8,759
3 votes
Accepted

Advanced version history in SharePoint

You are looking for Auditing. But be careful, it can pretty fast get out of control and fill the servers hard drive and affect the performance. Make sure to trim the Audit logs to fit your ...
user avatar
  • 9,491
3 votes

Add/delete list item using knockoutjs

Did you even try to google? http://mysharepointlearnings.wordpress.com/2013/11/20/knockout-js-with-sharepoint-2013-app-ii/ There are plenty of results regarding your problem.
user avatar
  • 1,224
3 votes
Accepted

Get id of current inserted item by javascript

Quick fix Reference entry object by this keyword: this.entry = webList.addItem(entryCreationInformation); to make it accessible in handler, then you could grab list item id: function success() {...
user avatar
3 votes
Accepted

get the title of the list

You can add a column render callback when you specify columns definition. "aoColumns": [ { "sTitle": "Shootout By", "mData": "Employee", "sWidth": "10%" }, { "sTitle": "Shoutout Date", "mData"...
user avatar
  • 28.2k
3 votes
Accepted

BreakRoleInheritance and Inherit Permissions ListItem

Using listItem.BreakRoleInheritance(false, false); to break inheritance for Folder1 is correct, if you want to have unique permissions set from this level on. But if you want Folder2 to inherit from ...
user avatar
  • 609
3 votes

How to modify Author field of ListItem

In order to modify/update the Author field using the client object model, you need to make sure to Load the Source Item Load the User Object with Source Context Ensure the User Object in the ...
user avatar
  • 311
3 votes

Limit only one entry per day per user in sharepoint list

You can use Event Receiver for this feature. So in item adding event you have to check whether the user who is adding item has already added any item for today.If yes then stop him for adding more ...
user avatar
  • 2,127
3 votes
Accepted

Group by responsibles (multiple values) in list view

You can not do it with out the of the box code as the People and Groups information is stored in one field, and the grouping is by one field. You can not split that field with a Calculated Column ...
user avatar
3 votes
Accepted

Dynamic link creation for each list item

Create a calculated column and concat "https://link/sites/sitename/Lists/listname/DispForm.aspx?ID=" and item id. This will suffice your requirement. Also if you want to display column value as a link,...
user avatar
  • 4,466
3 votes

Item permissions based on field

You can change the Created By field to the correct user with any script (CSOM, PowerShell, JSOM) You can tthen use: Item Level Security can be set on LISTs (List Settings -> Advanced Settings) As ...
user avatar
3 votes
Accepted

Display the Actual "Related Item" in a Task List using JSLINK?

According to your question description, It seems 1 Related Item is a lookup column value. Showing Link In this value, you have lookup item's Id. If we know list name and item's Id, then we can ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible