Tag Info

New answers tagged

2

Values for a multi-select field should come back as a Collection type. The values for the Collection are available from the results property which is an array. Here's an example. My multi-select field is Color. var call = jQuery.ajax({ url: url, type: "GET", headers: { Accept: "application/json;odata=verbose" }, success: ...


0

MultiSelect data will be returned in following JSON format "Roles": { "__metadata": { "type": "Collection(Edm.String)" }, "results": [ "Enter Choice #1", "Enter Choice #2" ] }, If you want to pull it, then you should use var roles = ''; for(i=0; i < this.Roles.results.length; i++) { roles += ...


1

The CSWP can return any content from the search index. Use it on your SharePoint 2013 sites when you are connecting to a search service and want to return indexed search results in your pages. The CSWP returns content that is as fresh as the latest crawl of your content, so if you crawl often, the content that the CSWP returns is more up-to-date than if you ...


0

ListItem resource does not expose ServerRelativeUrl property, you could use FileRef property instead. But still it does not seem possible to accomplish using SharePoint 2013 REST since FileRef property could not be retrieved for a projected field. And again SharePoint 2010 REST comes to the rescue! The following query returns Lookup field file url: ...


0

Document Set you can treat as a Folder in the Document Library. Hence for listing those you should use the Files EndPoint. Something like https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/Files The above query will give you all Files in that Library. For targeting a particular folder you can use Children. More on ...


0

SharePoint comes with two flavors On Premise - The server is installed and maintained by each organization. Developers has Full Control to do major tasks like Deploying Farm solution, Starting Search Crawls etc. Online - Microsoft manages the cloud version. You have minimal options to get things done. From Developers point of view, SharePoint offers ...


6

Farm Solutions (Full Trust): Develop for SharePoint On-Premises only. Can use managed code and the Server Object Model. This model has been around since SharePoint 2007 and is currently the most robust and well documented. Sandbox Solutions: Develop for SharePoint On-Premises or SharePoint Online. Can currently use managed code and a limited version of the ...


6

You don't interact with SharePoint's Database directly, you will rarely need to open SQL Server and see what's in there. You interact with SharePoint's data using SharePoint itself. So you will need to interact with lists and libraries that are responsible for your CRM system. SharePoint provides you with some ways to interact with it depending on where from ...


3

Batching is now supported in REST O365 only. You can check out a javascript library on GitHub that batches these for you using the new capabilities. https://github.com/SteveCurran/sp-rest-batch-execution


0

If user is Global admin then you can check user permission programmatically: SPUser currentUser = null; using (SPSite spSite = SPContext.Current.Site) { using (SPWeb web = spSite.OpenWeb()) { currentUser = web.CurrentUser; ...


0

Currently $skip query option is not supported in SharePoint 2013/Online. According to Use OData query operations in SharePoint REST requests: The $skip query option does not work with queries for SharePoint list items. But you could utilize $skiptoken query option to return paged results as demonstrated below. Format: ...


0

All the listed operations are supported. I would recommend you to check out the following informations on the web and MSDN: Working with files and folders with REST Working with list items with REST Upload files by using REST and Jquery


0

If the current user has not enough permission then you won't be able to check the permission itself. The best option is to run the permission check in APP context.


0

Here is an example from this question:Updating Lookup Values with the REST API var call = jQuery.ajax({ url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getByTitle('Sales Opportunities')/Items(5)", type: "POST", data: JSON.stringify({ "__metadata": { type: "SP.Data.Sales_x0020_OpportunitiesListItem" ...


2

You need to find an alternative way to make your cross domain calls. As stated by the error, you cannot use the WebProxy if you're not inside an App. The App context is needed to tell the WebProxy that the URL being queried has been approved (it's part of the App manifest) Try creating a SharePoint Hosted app for the feature you are building and following ...


1

I don't have enough reputation to comment so I can only "answer" :-( The answer from john-m sounds great but it does not seem to work? $select=AttachmentFiles,Title does return the expected result, AttachmentFiles as deferred url just $expand=AttachmentFiles without any $select= does work, gets all fields and an array of attachments But ...


0

It does not seem possible to retrieve Publishing Image fields directly in SharePoint 2013 REST. But there is a workaround, publishing fields could be retrieved using ListItem.FieldValuesAsHtml property via SharePoint REST endpoint as demonstrated below Limitation: it requires to perform two requests. How to retrieve Publishing fields using SharePoint ...


0

For getting data for multiple items in the list you can change your logic as below <script type="text/javascript"> var items = []; $.ajax({ url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items", type: "GET", headers: {"Accept": "application/json;odata=verbose"}, cache:false, ...


0

Try changing the url as below url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items?$filter=File_x0020_Name Eq 'FDAAgents'&$top=1&$expand=Roles",


0

Try this <script type="text/javascript"> $.ajax({ url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items?$filter=File_x0020_Name Eq 'FDAAgents'&$top=1", type: "GET", headers: {"Accept": "application/json;odata=verbose"}, cache:false, success: function(data){ ...


1

drop the (1) in the url. You are querying just item number 1. If you want to limit to 1 item use top. url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items?$filter=File_x0020_Name Eq 'FDAAgents'&$top=1" Watch your results though. returning 1 item comes back differently than returning a set of items ...


0

Change the URL as below url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items(1)/?$filter=File_x0020_Name Eq 'drugdealers'"


0

I don't think there is a contains operator available in REST filter options. You can use the substring instead var queryUrl = appweburl + "/_api/SP.AppContextSite(@target)/web/webs?$select=Title,Url,WebTemplate&$filter=WebTemplate ne 'APP' and substringof('" +checkTextTypedIn+"',Title)&@target='" + hostweburl + "'"; The above query will return ...


1

The app hosted in SharePoint creates a sub site under the Host Site. This sub site is called App Web and it has the same name as that of the app. A filter needs to be added to the REST query so that this app web is the not included in the result set. Suppose the name of the app web is "App1", the filter will look like this: $filter= Title ne 'App1' In ...


1

Date Time operations just like filtering for a date time is not supported. I tried it in many ways and never had a luck. You have to stay with the listdata.svc for that. Check out this post by Microsoft http://msdn.microsoft.com/EN-US/library/office/fp142385(v=office.15).aspx You will find all supported and unsupported OData query operations. Date and ...


0

toupper is not supported. Below is the list of supported functions On the other hand if you use ListData.svc endpoint you can use toupper to perform a similar query.


0

You have to make an array out of the response data to provide the values for the source of the autocomplete widget. In the callback you need to take the returned data and transform it a bit, I would also recommend changing your request URL to only pull the data you want from the webs instead of retrieving everything by using a $select statement. ...


0

AutoComplete should be initialized as below $('#autocomplete').autocomplete({ source: subsite });


1

below is the rest end point for sending email /_api/SP.Utilities.Utility.SendEmail It will only send email to internal users. Source How to send email in SharePoint Hosted apps 2013 for SharePoint Foundation?


0

SharePoint stores dates in the ISO string format. So convert the EndDate and EventDate values first using toISOString(). Also Use ge for greater than instead of >. Similarly use le for less than instead of <. Finally use and to combine two filters together.


1

I have solved my problem following way $.ajax({ url: "host url"+"_api/web/lists/GetByTitle('List Name')/fields?$filter=EntityPropertyName eq 'Choice Field Name'", type: "GET", headers: { "accept": "application/json;odata=verbose", }, success: function (data) { ...


1

Below is the code for retrieving choices of choice field function getFieldChoices(fieldName, listName) { var dfd = $.Deferred(); hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl')); appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl')); var urlTemplate = appweburl + ...


2

Try this https://mysite.com/site/_api/web/lists/GetByTitle('Posts')/items?$filter=Alert eq 1


0

Try this query ?$select=Author/Id,Author/Name,Author/Title,Editor/Id,Editor/Name,Editor/Title,*&$expand=Author,Editor


0

This is a limitation on SharePoint. REST API filter by month The workaround Use 2010 REST endpoint ListData.svc Create a calculated field, and then use CAML query


2

You need to $select and $expand the AttachmentFiles property for your list items if you want to select many items from the list. _api/lists/getByTitle('MyList')/items?$select=AttachmentFiles,Title&$expand=AttachmentFiles Then you can get attachment info (if it exists) in the AttachmentFiles property of your list item which will be an array of ...


1

The $skip parameter does not work in SharePoint 2013 for list items. It only works for collection of data (like list collections, etc). Paging using REST/OData with SP 2013 A workaround is to use __next property which gives you the next URL you should query. http://stackoverflow.com/questions/18964936/using-skip-with-the-sharepoint-2013-rest-api


0

You can get attachments using var url = url + "/_api/web/lists/getbytitle('ListTitle')/items(1)/AttachmentFiles"; $.ajax({ url: url, accepts: { json: "application/json;odata=verbose" }, method: "GET", success: onQuerySuccess, error: onQueryError }); function onQuerySuccess(data) { if (data) { ...


0

@Nadeem Yousuf is correct. You should escape it using either double quotes or by using \ Here is a little function you can use for that function escapeApostrophe(title) { title = title.replace(/'/g, "''") return title }


1

Use two quotes. That is 'Shekar''s.pptx'


0

You could use the following powershell script to add your account to the site collection before hand, you could also provision the onedrive sites. I'm working on a similar project myself. Onedrive for Business - Assign a user as a site collection administrator to OneDrive for Business sites


1

First you need to add jQuery references to the Page as below <script type="text/javascript" src="path/jquery-min.js"></script> Now you can activate a REST call as follows var url = RESTQUERY; jQuery.ajax({ url: url, type: "GET", headers: { "accept": "application/json;odata=verbose", ...


0

The JSON Body Should be "{ 'query': { '__metadata': { 'type': 'SP.ChangeQuery' }, 'Web': true, 'Update': true } }"


0

Figured out the issue: The parameters such as Web and Update must be inside the query object, not outside.


0

Under the assumption that you are asking about the SP2013 REST API. Yes, but you would have to perform a few more conversions/comparisions like day(), month(), year() manually. The oData Query Operators supported by SharePoint REST Api are listed here: http://msdn.microsoft.com/en-us/library/fp142385.aspx



Top 50 recent answers are included