Hot answers tagged

7

The internal name for columns replaces colons with _x003a_ just like you suspected. So a column named Image:Thumbnail should be Image_x003a_Thumbnail as you suggested. I'm guessing that the display name was changed later and the internal name is different. You can find the name of all your internal fields via the REST API and this will probably shed some ...


7

Do you use Javascript to send "Like"? At this case you could use JSOM to set likes: <script type="text/javascript"> SP.SOD.registerSod('reputation.js', '/_layouts/15/reputation.js'); SP.SOD.executeFunc('reputation.js', 'Microsoft.Office.Server.ReputationModel.Reputation', function () { SP.SOD.executeFunc('sp.js', 'SP.ClientContext', ...


6

Please try following REST URL, you must expand the Person and Group field. var Ownurl = _spPageContextInfo.webAbsoluteUrl + "_api/web/lists/getbytitle('Listname')/items?$filter=Id eq 1&$expand=Author&$select=Author/Id"


5

The below example demonstrates how to like/unlike a resource via SharePoint REST API, it simulates Microsoft.Office.Server.ReputationModel.Reputation.setLike method to some extent Prerequisites: Rating settings needs to be enabled per List var Reputation = Reputation || {}; Reputation = (function () { function executeJson(options) { var ...


5

Try following. I am assuming that you have included Title column in your lookup column. Building a clause for ProjectName="X" and Active="Yes", you have to use $filter operator. http://<siteurl>/_api/lists/getbytitle('Project%20Locations')/items?$select=Title,ProjectName/Title&$expand=ProjectName&$filter=Active eq 1 and ProjectName/Title eq '...


5

For me the answer is pretty obvious: for sure you should use it. A few things why I think so: the learning curve is very straightforward and not so difficult pnpjs is a wrapper on REST API, by using jQuery\REST you will create your own "pnpjs". In that case, why reinvent the wheel? pnpjs has some other things except just wrapping around REST. For ...


4

For few items in ID's array, then you can try following /_api/Web/Lists/GetByTitle('User Information List')/Items?$filter=(Id eq 426) or (Id eq 352) or (Id eq 155) It will give you all users in one request. Remember GET request has MAX URL length. For many items in ID's array, you have to use CAML & POST. CAML Should look like <Where> <...


4

Just an issue with the parameter type; the itemID needed to be the ID, not the GUID. Documentation here: https://msdn.microsoft.com/en-us/library/dn683475(v=office.12).aspx


4

You can use following end-point. It can search users from all directories. var userSearchSuggestionEndpoint = "/_api/SP.UI.ApplicationPages.ClientPeoplePickerWebServiceInterface.clientPeoplePickerSearchUser"; HTTP post request is needed to get data from above end-point. Request payload is given below. var data = { queryParams: { __metadata: { ...


4

You can combine these two by $expanding ListItemAllFields column of the File. ListItemAllFields is __deferred property of File. I believe you know that we need to $expand all Lookup columns and __deferred properties to get information. Anyway, from ListItemAllFields you can get all information what you get from /_api/Lists/GetByTitle('Pages')/Items?$select=...


4

This parameter was replaced with -NoAzureADLookup


4

The the following expression demonstrates how to filter by lookup field id: &filter=fields/<LookupFieldName>LookupId eq '<LookupFieldValue>' Pay attention to lookup field name format, in Microsoft Graph lookup field value is exposed for Lookup Id by default Example Lets assume Employee list contains Department lookup field (refers to ...


4

That is happening because you are creating list columns directly from the page. Like in below image. Instead of doing that, would suggest that you go to the list/library settings page by clicking on the gear icon in top right corner and then click on list or library settings. After that, click on create column option, do scroll down a bit and then do ...


3

ok...first version of the script (with $.ajax) is the regular way to execute CRUD operations on items in lists (external and internal)..unfortunately it works only for internal list (by my experience)...so i've searched (for days) another way to execute insert statement (update and delete works with $.ajax) and I found a solution in a book (https://www....


3

To add/update Person or Group field, you need the Id of Person or Group. Let say, Person or Group Id is 11 and internal name of the field is PersonField. So the request will be var data = { PersonFieldId: 11 }; PS: Don't forget to add Id with the field's internal name. I wrote details in my article CRUD Operation to List Using SharePoint 2013 Rest API


3

This is because of a minor typo in the post data. The "t" in the "type" object property should be lower case: {"__metadata":{"type":"SP.User"},"LoginName":"i:0#.w|abc\\nick"}


3

As far as I know REST API batching is only supported in SharePoint Online and SharePoint 2016. Support for REST API batching did not get pushed down to SharePoint 2013.


3

"429 TOO MANY REQUESTS" itself a detail error message. It says that you are exceed of request limit for particular time. Normally this error comes when you try to request more than 1 request in 1 second. So the thing you can do is go through Avoid getting throttled or blocked in SharePoint. It may give you the basic idea behind this error and you may find ...


3

The problem is with the $select query, $select query option is to specify which fields to return for a given list, list item, or other SharePoint object represented by an entity set. Your ProjectList will not have a field Site/Region/Title, that is the reason your are getting an error The query to field 'Site/Region' is not valid for the first URL. And as ...


3

Most likely this is because you are making an http request on an https site, this is a security issue and browsers will block it. Check to see if they offer the api over https and use that instead.


3

Ok i found the problem... First: The API calls were both correct. The fact is that I am developing with Nodejs and I realized that the request module automatically converts the result to utf8 as the documentation says: encoding - Encoding to be used on setEncoding of response data. If null, the body is returned as a Buffer. Anything else (including the ...


3

Option 1 The endpoint you need to hit is as below: https://one365dev1.sharepoint.com/sites/nieuwsportaal/_api/web/lists/getByTitle('Nieuwsberichten')/fields?$filter=EntityPropertyName eq 'Hoofdcategorie' In the json, the values would be retrieved somewhat as : data.d.results[0].Hoofdcategorie.results Generic endpoint: /_api/web/lists/GetByTitle('List ...


3

Try this https://one365dev1.sharepoint.com/sites/nieuwsportaal/_api/web/lists/GetByTitle('List Name')/fields?$filter=EntityPropertyName eq 'Choice Field Name'


3

To get data from multiple list at a same time, we need to parallel Ajax get request for getting data from more than one list. Let's take one example: We have two list named "List1" and "List2" and we need to get all items from both lists. We create one module for get item: var getModule = (function () { var baseRequest = { url: "", ...


3

To return unlimited results, just drop the $limit=1000 from the query. EDIT: Indeed SharePoint by default returns 100 items of the list. The correct way to return a bigger subset of items would be to use $top= in the query. However, note that this default value of 100 is implemented most importantly for performance reasons. This means that it would be ...


3

If you want a reference to a SP.User stored on a SP.ListItem the user must exist in the SP.UserCollection siteusers of the specific SP.Web (i.e. tenant.sharepoint.com/sites/web/subweb/_api/web/siteusers). The reason for this is that only the local reference to the Id in the siteusers-list is stored when a user is referenced (using a SP.FieldLookup). So ...


3

First, you're missing a slash between getbytitle('listname') and Items, should be: <siteurl>/_api/web/lists/getbytitle('<listname>')/Items/?$select=Title,Response_x0020_Time Now I'm going to have to make some assumptions, because you didn't provide any information about the field types upon which the calculation is based, or the expected type ...


2

I would either built a small console app using CSOM or use PowerShell and CSOM together. I haven't checked if this code works, but it probably look something like this: using (var context = TokenHelper.GetClientContextWithAccessToken(uri.ToString(), token)) { var web = context.Web; using (var fs = new FileStream(...


2

If you want to perform CRUD operation on SharePoint Online lists, for that you can use C# code with console app or window app or else create web application. The same requirement i was also having. So i used C# console application. And yes you need to authenticate first, and for authentication you can use Username and Password into the code itself which ...


2

With the new version of CSOM released for office 365, Microsoft.SharePoint.Client.RecordsRepository.Records namespace can help to declare/undeclare item as record. More details about the latest CSOM version can be found here.


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