Tag Info

New answers tagged

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.


0

The following example demonstrates how to order Posts by Category field. But there is one important note here: Since Category field is a multiple choice field value, it is assumed that only one category could be specified per post. For that purpose FirstCategoryTitle property is introduced which represent the title of first category in ...


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({ ...


0

The error: Only properties specified in $expand can be traversed in $select query options. Property . occurs since it seems the $expand query option syntax: $expand=<lookupfield>/<projected property> is not supported in SharePoint 2010 REST Interface. Solution Use the following query instead: ...


0

Tenant ID is nothing but SharePoint Online Site Realm. You can get this by having a REST call to the site API. Follow below steps: Make a Get request GET https://your_site.sharepoint.com/_vti_bin/client.svc Header: Authorization: Bearer Get the Bearer realm component from the response header and save it. Check the below post for complete step to ...


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

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


2

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


0

I am affraid, you will not bypass this limit. MSFT enfoce this limit from 2003. there is a limitation in URL length as 260 characters. Please check this article to understanding the URL path length restrictions Even, if you able to upload a file with long name, but still it will not for the user, becuase when user trying to edit or open the doucment then ...


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

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

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. ...


0

The following example demonstrates how to: initialize SP.BasePermissions object from json object determine user roles using SP.BasePermissions.has(perm) Method Example: function getListPermissions(webUrl,listTitle,accountName) { var endpointUrl = webUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/getusereffectivepermissions(@u)?@u='" + ...


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 ...


0

After some more Research I was able to find an answer. Most of the examples I found online was regarding file upload from local Client, which implies handling of the local file, e.g. by the File API. Since I am Reading the file from a service, I don't need to consider this, and the result turned out to be simpler than I thought. The rough process is as ...


0

Use List.EffectiveBasePermissions property to retrieve the effective permissions on the list that are assigned to the current user Use BasePermissions.Has method by specifying PermissionKind.ViewListItems to determine whether current user could access List The example shows how to determine whether current user could access list or not: function ...


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

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 = @(); ...


0

I haven't tried this before for merging two calendar but i know you can. Previously i used this technique to export calendar item from old calendar to a new one and it worked well. Export both the calendar item to an excel file and merge those excel data. once all data cleansing is done import the excel file into the newly created calendar. Note: if you ...


0

I believe the scope you want to use for your AppPermissionRequest is "http://sharepoint/content/sitecollection" (I've successfully used this for Workflow app steps in the past). Note that you want to use this literal string and not replace any of it with URLs from your SharePoint farm. "Content" refers to your content database. Table 1 at this MSDN article ...


0

You can do something similar as below String req = "http://sp2k13/sites/ifsp/_api/Web/Folders/add('LibraryName/FolderName')" NTCredentials credentials = new NTCredentials(UserName, Password, "JAVA-MACHINE-NAME", "DOMAIN"); HttpClient httpClient = new HttpClient(); httpClient.getState().setCredentials(AuthScope.ANY, credentials); ...


0

there is a similar question on this site as yours. have you gone through that ? question public void createFolder(String digest) throws ClientProtocolException, IOException { HttpPost request = new HttpPost( "http://industrial-ex/sites/tifdemo/_api/Web/Folders/add('enovia/newfolder')"); request.addHeader("Content-Type", ...


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 ...


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.


0

I assume it is by design. I can reproduce it if the lookup field can contain multiple references. If it is single lookup column, there is no error.


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 = ...


0

Are you using this code against SharePoint Online / O365 or against an on-premise SharePoint server? AFAIK, the $batch operation is supported only in case of the former ones, see this post: SharePoint Online and the Office 365 APIs implement the OData $batch query option


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 ...


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 + ...


0

The "Accept" dictionary parameter has a "/" character which is being rejected by SharePoint 2013 workflow. You can test this by excluding the "/" character and it should work. In my case a custom password field in a SharePoint list contains a "/" because its encrypted. I was trying to pass the password field to the web service call in the workflow and got ...


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 ...


1

Add following to your REST query $select=FileLeafRef



Top 50 recent answers are included