New answers tagged

0

I resolved this way, and its working fine now with adding single PP field and Multiple PP field to a List... HEre is my code: $scope.saveNewPage = function () { var title = $scope.newPage.title; var descr = $scope.newPage.description; var ppSingleVal = $scope.vm.data.su; var ppMultiVal = $scope.vm.data.mu; ...


0

You should do something like this var revisor = $("#cppRevisor").getUserInfo().Id; LookupField.set_lookupId(revisor); newItem.set_item('Revisor', LookupField); var aprobador = $("#cppAprobador").getUserInfo().Id; LookupField.set_lookupId(aprobador); newItem.set_item('Aprobador', LookupField); Where $("#cppRevisor").getUserInfo().Id and $("#cppAprobador")....


0

If you don't explicitly know that these fields exist prior to calling the items endpoint, then it would be helpful to make a call like /_api/web/lists/getbytitle('Thing')/Fields and look for the desired fields. If they exist, then you can call your items endpoint with your select and expand params, otherwise you don't.


0

Liz, Here is the post Display REST Data that will solve your issue. Thanks


2

Your JSON for updating list item should be like this. { "__metadata":{ "type":"SP.Data.YourListNameListItem"}, "securit_x00e9_":"test", "column":"test", "numero":"test", "Title":"test" } In type you must write "SP.YourListNameListItem" Update-1: Try removing securit_x00e9_":"test" line from your JSON, if its update then you have to try the JSON as ...


0

You can use remote authentication like what is done in this page http://paulryan.com.au/2014/spo-remote-authentication-rest/. I have already tried this one and it works, you just need to follow the steps. You just need to get the security token in order to get the access token cookies. Cookies are necessary as a header when making requests and for getting ...


1

You don't have to deal with __metadata. Just specify your ContentTypeId in your request body and that's all. data: JSON.stringify({ __metadata: { "type": "SP.Data.Example_x0020_ListListItem" }, Title: "_", field1: "val1", field2: "val2", field3: "val3", ContentTypeId: "Your content type id" }) In the __metadata you need ...


1

For updating custom column while uploading file you use following code with this answer function upload() { // Define the folder path for this example. var serverRelativeUrlToFolder = 'SiteAssets'; // Get test values from the file input and text input page controls. var fileInput = jQuery('#getFile'); var newName = jQuery('#displayName'...


0

//For updating custom column while uploading file you use following code with yayati's code function upload() { // Define the folder path for this example. var serverRelativeUrlToFolder = 'SiteAssets'; // Get test values from the file input and text input page controls. var fileInput = jQuery('#getFile'); var ...


0

According to msdn you can use [$select=* t][1] query, which should return all the fields that are available


0

Assuming you've got you're authentication working, you might want to look into the new Rest endpoints of SharePoint online. Here's a reference: https://msdn.microsoft.com/en-us/library/office/jj860569.aspx The /_vti_bin/ListData.svc endpoint still exists but I think it's deprecated. The new rest endpoint follows the odata standards. Give a call to http://...


0

I found a way. So I have to use select if I use expand so I just changed this part: $select=*,Assigned_x0020_To/Title&$expand=Assigned_x0020_To/Id It still collects all the fields, but makes sure to expand the specified field.


0

If you add select clause then that will limit the fields that is being brought back. If you are worried about the URL length then you can also try CAML query along with JSOM or REST.


0

Here is how i resolved my case with updating a List Item with Managed Metadata Column. function execRequest() { var taxPickerIndex = $("#taxPickerOpenSingle").val(); var result = $.parseJSON(taxPickerIndex); var listTitle = "GNTiles"; var taxFieldName = "Process"; var termId = result[0].Id; var term = ...


0

Here is how i resolved my case with updating an existing List Item with Managed Metadata Column using JSOM: function execRequest() { var taxPickerIndex = $("#taxPickerOpenSingle").val(); var result = $.parseJSON(taxPickerIndex); var listTitle = "GNTiles"; var taxFieldName = "Process"; var termId = result[0].Id;...


0

To update managed metadata column, you need to get the associate termSet for the column and also get the term Id from that termset. To update Managed Metadata column using REST check this Below is the code to add the item with managed metadata column using JSOM. Read Comments in code for more description. jQuery(function($) { var scriptbase = ...


0

I am checked using JsonObject.has("KeyName") it return boolean. its give true if object contain that keyvalue. so using this method you can make your logic. Thank you very much for reply.


0

It seems ChildCategory and SubCategory are not required column. So at the time of parsing your JSON, you need a condition. if(ChildCategory.Title && ChildCategory.ID){ } Another option can be $filter. Just $filter null values for ID and Title so that they do not appear in the result. &$filter=ChildCategory/Title ne null and ChildCategory/ID ...


0

You can invoke a REST call from C# Client Application or JavaScript The REST call you are mentioning relates to Social Feature and more on this is explained in msdn https://msdn.microsoft.com/en-us/library/office/dn155789.aspx#bk_myUnreadMentionCount The endpoint is <siteUri>/_api/social.feed/my/UnreadMentionCount If you are making these REST ...


0

For posting multi user field the format we should use is FieldName: {"results": [UserId1,UserId2....] } From people picker control you can get the user ids as explained in the msdn article https://msdn.microsoft.com/en-us/library/office/jj713593.aspx


0

You should add a '&$', not just '$' before the orderby clause, like this: "$select=Title,Description,Enlace,EncodedAbsUrl,Categoria/Title&$expand=Categori‌​a/Title&$orderby=Categoria,Title asc";


0

For cross site collection scripts to work in app you have to do below things: Tenant level permissions Tenant scope deployment of the app.


1

Well, it looks like I was doing a few things wrong. The ColdFusion language I use passes arguments as a structure, the order does not matter. This appears to not be the case for Sharepoint. ex: files/add(overwrite=true,url='#arguments.filename#') is not the same as files/add( url='#arguments.filename#'; overwrite=true; ) I also had [;] ...


0

Well, it looks like I was doing a few things wrong. The ColdFusion language I use passes arguments as a structure, the order does not matter. This appears to not be the case for Sharepoint. ex: files/add(overwrite=true,url='#arguments.filename#') is not the same as files/add( url='#arguments.filename#'; overwrite=true; ) I also had [;] ...


1

The problem for you is that you only have Term Label and Term Guid is not available. There is no REST API support for term store yet, so you cannot query the termset and get the guid for the Term Label. If you are looking for C# CSOM code to update taxonomy field value see this Post


1

Finally after working more than 2 days I found the solution. Actually I was making a mistake in using GetFileByServerRelativeUrl() method. I was using url as: var url = siteUrl + "_api/Web/GetFolderByServerRelativeUrl('" + libraryName + "/Tss_RootFolder/" + documentSetName + "')/Files/getbyurl(url='" + fileName + "')/listitemallfields"; I just changed ...


1

I found out what the problem was. After checking the EventViewer (which is recommended) I found some exceptions related to my custom service service similar to "...more than one endpoints configured...". I therefore fixed my configuration by adding this: <webHttpBinding> <binding name="RestBinding"> <security mode="None" /> </...


0

I found a tutorial yesterday that had one sort term in the post query. It took a bit of work to figure out how to do multiple terms. Here is what ended up working for me: 'SortList' : { 'results' : [ {'__metadata':{'type':'Microsoft.SharePoint.Client.Search.Query.Sort'}, 'Property':RefinableDecimal00,'Direction':0 }, {'__metadata':{'...


1

This is what you need to use: <your_site_url>/_api/Web/Lists?$filter=BaseTemplate eq 101. The base template 101 is for document libraries. For other types of lists, check the base templates here: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.listtemplatetype.aspx There is no built-in functionality to get only the libraries ...


4

The ID is an object property, so you need to access it like an object property using the square bracket notation instead of dot notation: var array = ["ID", "Title"]; data.d.results[i][array[0]]; Using the bracket notation, JS will translate [array[0]] into [ID] which is equal to .ID (notice the dot). Using the dot notation, JS expects array[0] to be an ...


0

It doesn't look like this is possible. I just tried creating a site column as a lookup field in the site collection root, then I added it to a list in a child site. The field names are correct in the list, i.e., there's no weird appended root site name or ID in the column name for the REST query, but I still get: <m:error xmlns:m="http://schemas....


0

I establish content types based on the business need and bind the required metadata. Once the content types are set, I bind a document template to the content type so a user can open it directly in the library. Using MS Word Quick Parts, I insert controls into the document template so the metadata values are presented directly to the user. Kind of like ...


0

Can you already see the file uploaded to the real Sharepoint site? (this is not an answer, for now I can't post a comment)


0

http://<site url>/_api/web/webs This call is not enough, unless if all users are allowed to access a subsite. It will throw a System.UnathorizedAcces exception if a subsite is not available for access to a certain user.


0

This may not be what you're trying to do, but I wrote a c# console application that will upload documents from my local system to SharePoint while setting the appropriate meta data for our organization (via the Microsoft.SharePoint.Client.Online.CSOM nuget package). Unfortunately, I can't share the code in full, but I can share enough to give you a really ...


2

SPBasePermissions is implemented as a bitmask, which allows a number of values to be stored in a single integer. This concept is commonly used in security scenarios. The number 32 represents the minimum permission needed to view the site. A general intro to bitmasks: https://en.wikipedia.org/wiki/Mask_(computing) James Tsai's explanations of bitmasks as ...


0

As a thumb rule.. Use REST APIs for list data operations, for rest of requirements better to use client side APIs. REST APIs doesn't support Taxonomy retrieval/manipulations, please use client side APIs.


3

Approach is same for sub-site or main site. The only thing matter is URL {sub or main site url}/_api/Web/Lists/GetByTitle('listname')/Items CRUD Operation to List Using SharePoint 2013 Rest API You will get the full document in my above article.


1

You can't use REST API to filter list view (for exemple your SPView: /TestList/AllItems.aspx) To filter list view you should use CAML query (in the list settings, you could edit your views, and ADD filter to fields of your list). (ou can group, and do operation like count/sum/avarage ....). The user will not view this filter (so give to it a good title). ...


1

You can apply filters when you use that endpoint by add /Files like this: mysharepointsiteurl/_api/web/GetFolderByServerRelativeUrl('/relativesiteurl/Documents')/Files?$filter=TimeLastModified gt datetime'2015-11-1T00:00:00' But you can also just use the standard list endpoint and that's a bit easier: mysharepointsiteurl/_api/web/lists/getbytitle('...


0

yes you can filter data of list using REST API ! check this link, a tutorial by Microsoft : Use OData query operations in SharePoint REST requests


0

You can also use PnP JavaScript library, which is open source and developed using SharePoint REST API. To check the list, use the below snippet, $pnp.sp.web.lists.getByTitle('Site Awssets').get().then(function(result) { console.log('List Exists'); }).catch(function(err) { console.log('List not found'); }); To know more about PnP, check the below links, ...


1

You can filter lists by title using odata and count results. url pattern: http://{your_site}/_api/Web/Lists?$filter=title eq '{your_list_title}'


0

You can try this type of query: /_vti_bin/ListData.svc/ChildList?$expand=lookupcolumn_name$select=FieldA,FieldB You will get some reference from @wjervis's answer.


0

You can do it as below "_api/web/lists/getbytitle('DocName')/files?$expand=groupName&$filter=groupName/Id eq 2"


2

One option would be to convert search value (SPKeyValue type) into choice field value (collection(Edm.string) type) once the search results are returned. JavaScript example function castToChoiceValue(searchValue) { if (searchValue.Key == "MultiChoiceField") { var value = { "__metadata": { "type": "Collection(Edm....


1

Below snippet can be used to update MMD field var termValue = "-1;#" + termLabel + "|" + termGUID; item.set_item("Process", termValue); item.update();


1

Refresh the token in Form Digest The two most common ways are to either use ye olde web services and call into the /_vti_bin/sites.asmx and use the GetUpdatedFormDigest method. To use this you have to create a SOAP message and then parse the response and retrieve the updated token. You can then either pass that new token for your subsequent requests, or ...


2

To get the ListItem details using REST API, we have to call the below endpoint, https://webappname/sites/sitecollection_ name/_api/Web/GetFileByServerRelativeUrl('/Sites/sitecollection_name>/en-US/Pages/TVM3.aspx')/ListItemAllFields GetFileByServerRelativeUrl( <server relative url of a file>) ListItemAllFields property returns all field values ...


1

You can retrieve page properties from a Pages library using REST just like any other list/library. For the above URL you could get that item using the following REST URL: http://<webappname>/Sites/<sitecollection name>/en-US/_api/web/lists/getbytitle('Pages')/items?$filter=FileRef eq '/sites/<sitecollection name/en-US/Pages/TVM3.aspx' It ...



Top 50 recent answers are included