Tag Info

Hot answers tagged

3

It appears that the list resides in Host web instead of the App web. In this case the app needs to be given permission to read the List of the host web. Moreover, the REST call needs to be done using cross domain library. Example of cross domain call using REST: executor.executeAsync( { url: appweburl + ...


3

In order to return list url you could utilize List.RootFolder.ServerRelativeUrl property. Some recommendations From performance perspective prefer server side filtering over client side one, the example below demonstrates how to query lists filtered by BaseTemplate: /_api/Web/Lists?filter=BaseTemplate eq '101' Example $.ajax({ url: ...


2

First Add an img element to display Images <img id="imageRotator" > Now use below JavaScript function to get Images var arrayOfImageObjects = new Array(); var currentImageIndex = 0; function GetImagesAndRotate() { var url = "http://siteurl/_api/web/lists/getbytitle('ImageLibrary')/items?$expand=File" jQuery.ajax({ url: url, ...


2

When you create or deploy app to the SharePoint it creates a web of its own(even your app may have list and libraries of its own) so app is nothing but a site in your SP, now when you try accessing the your site from this SP App SharePoint won't allow it due to security reasons, and you may get Access Denied error, So to overcome this you need to make a ...


2

Try this (Excerpt from here): function getListItem(url, listname, id, complete, failure) { // Getting our list items $.ajax({ url: url + "/_api/web/lists/getbytitle('" + listname + "')/items(" + id + ")", method: "GET", headers: { "Accept": "application/json; odata=verbose" }, success: function (data) { // ...


2

The query /_api/lists/getbytitle('<list title>')/items?$select=* returns list items for visible fields only (SP.Field.hidden property is set to false). To be more precise the expression $select=* returns: visible fields values (query that returns visible field names: /_api/Web/Lists/getByTitle('<list ...


2

Checkmark is a read-only field. Try changing PercentComplete to 100


2

To get the choice values from listdata.svc you need to make a request against the correct EntitySet... You can think of an EntitySet as any list that listdata.svc has access to -- this includes choice field choices. Choice field EntitySets will typically have an endpoint name that looks like: <ListName><ChoiceFieldName> So if I have a list ...


1

Assume the list contains the following data: ID ListingOrder 1 1 2 null 3 2 Then you could consider the following options: Option 1 The items could be sorted in descending order: $orderby=ListingOrder desc, in that case the items for those listingorder property is not specified will be listed as the last ones. Result: ID ListingOrder 3 2 1 ...


1

You can use two queries in that case. First query - Get all items filter by ListingOrder not equal NULL Second query - Get all items filter by ListingOrder equal NULL Apply Order By only on First Query. Then merge the result sets.


1

You could try EnsureUser method to check whether the specified login name belongs to a valid user in the site. If the user doesn't exist, adds the user to the site. Example function ensureUser(accountName) { var endpointUrl = _spPageContextInfo.webAbsoluteUrl + "/_api/web/ensureUser('" + encodeURIComponent(accountName) + "')"; return $.ajax({ ...


1

You should may be use new ZacTestModal() instead of new ClearanceModal() in your javascript ko.applyBindings


1

You could call /Web/SiteGroups with multiple $filter values, e.g., _api/Web/SiteGroups?$filter=Title eq 'GroupA' or Title eq 'GroupB' Afterwards you would have to cross-reference results with your own names, e.g., with underscore: _.difference(yourGroupNames, _.pluck(groups, 'Title'))


1

If you are using SharePoint on-premises you can't create the library and the custom columns in a single call using the REST API. You need to make a call to create the library and then make subsequent calls to create each of the custom columns. The REST API in SharePoint Online now supports batching so you can create the library and the custom columns in a ...


1

I don't think you can create fields (columns) in a list/library at the same time when creating it as the REST endpoints for list/library and fields are different. So you will have to first create your document library and then add fields to it. The Fields REST API reference on MSDN is a pretty comprehensive guide on how to create different type of fields. ...


1

I'm not sure if a column can be created at the same time, but perhaps this example will guide you on how to create a column: // Create a new list field function createField() { var fieldName = document.getElementById("createlistfieldname").value; var executor; // Initialize the RequestExecutor with the app web URL. executor = new ...


1

Yes, it is possible.. Try the following request: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=Department If this doesn't work you might need to use the following: For Office 365/SharePoint Online: ...


1

I don't think you can (yet, perhaps in SP 2016), see Query SP2013 Managed metadata term store - Use JSOM. Since you use Angular I would suggest your wrap SP.ClientContext in a promise, this way you can use both JSOM and REST ($http) together fluently, like this: Setup: var ctx = SP.ClientContext.get_current(); ctx.exec = function() { return ...


1

your first REST query should work as long as internal name of the position column is same. You can check by running below query which will display the metadata for columns along with their columns. http://thisbox/_api/lists/getbytitle('ThisList')/items you will see something like this: <d:User_x0020_ModifiedId ...


1

Not a direct way. Select only responds to the name/GUID. You would have to do an additional pull to http://thisbox/_api/lists/getbytitle('ThisList')/Fields in order to return the list of names, internal names and GUIDs and cross-reference accordingly.


1

So the solution is to run this PowerShell script on the web application providing the information: Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0 $localFarm = Get-SPFarm $webapp = Get-SPWebApplication "http://XXX---URL_OF_PROVIDING_WEBAPP---XXX" # Remove old web.config modifications of MyAuthenticationProvider $oldMods = @(); ...


1

I believe you need to use XMLHttpRequest for this var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if (this.readyState == 4 && this.status == 200){ //this.response is what you're looking for handler(this.response); console.log(this.response, typeof this.response); var img = ...


1

You could use the following endpoint for getting Folder permissions: /_api/Web/GetFolderByServerRelativeUrl('<folder url>')/ListItemAllFields/RoleAssignments Example The following example demonstrates how to retrieve permissions details including Member and RoleDefinitionBindings info for a Folder and print it: function getJson(url) { return ...



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