Tag Info

New answers tagged

1

You can invoke following REST call from the Workflow http://your_sp_site.sharepoint.com/_api/web/siteusers and get the user in question (using filter) and get the PrincipalId into a variable. And use it as part of the actual REST call. http://siteurl/_api/web/siteusers?$select=Id,Title&$filter=substringof('\username', Title)


1

Isn't possible expand lookup via Rest Api. Only for user(column default) and field with atribute Deferred. But have solution for this: loop items and get all items and selecting only the SpeakersID _api/Web/Lists/GetByTitle('Topics')/items?$select=SpeakersId will return as show image below: but isn't suficient for get user info: Update(2): then you ...


0

The REST API doesn't seem to want to fetch the UserName field, try Name instead and you should get the value that's actually in UserName even though my User Information List has a field called Name with a different value in it. I find Id works when proper cased, but not upper (so no ID) Try this query: _api/web/lists/getbytitle('Topics')/items(1)? ...


0

You should use the $expand feature as follows _api/web/lists/getbytitle('ListTitle')/items?$expand=RelatedLinks&select=RelatedLinks/Title


1

Since you are trying to get items you should change the URL as follows /_api/Web/Lists/getByTitle('Contacts')/items


0

It might not be te most elegant solution, but this will get them into which ever group you put as $group. If your AD is on-prem follow this first. If they are already synced to your Azure AD, then just run the below code. function Connect-SPOSite() { param ( $admuser = "user@tenant.onmicrosoft.com", $admsite = ...


0

Using EnsureUser works http://msdn.microsoft.com/en-us/library/office/dn499819(v=office.15).aspx#bk_WebEnsureUser Just pass the GroupName and you can get the principalId of the group


3

When you use URL _api/web/lists/getbytitle('TestList')/items(1)?$select=FolderUrl You will get two properties d:Description d:Url So you don't need to expand <m:properties><d:FolderUrl m:type="SP.FieldUrlValue"><d:Description>Google ...


0

You can use following URL to get users from a site group http://sitename/_api/web/sitegroups/getbyname('Owners')/users REST using OData protocol. So for pagination you can use $top and $skip


0

Based on the discussion in REST with $filter for List Items in Sharepoint 2013 question: Option 1 Since filtering on FileSystemObjectType property does not seem to work using $filter query option in SharePoint 2013 REST,you could consider a another option, i.e to filter by FileSystemObjectType property using CAML query instead as demonstrated below: ...


0

SP.Folder.serverRelativeUrl property accepts the following formats: /Site_Name/SubSite_Name/Library_Name/File_Name Library_Name/File_Name Assuming the following structure: / (Root site) News sub site Documents library the following examples demonstrate how to create a Folder: Case 2 Example 1 Url: ...


0

As far as I see the value of the ServerRelativeUrl parameter in #2 and #3 is not correct. See the examples on MSDN you reffered to. In #2 it is simply the folder name, in #3 the leading slash is missing. Should be '/Shared Documents/new folder created' instead, the same value yuo use in the working #1. I suggest you to use Fiddler or another network ...


0

I've managed to accomplish this by doing the following. Once I've added my permissions to a folder or a file I do a clear up. I remove the role Full Control from the admin account. When I go to remove the admin from the users site, the admin account no longer appears and no files are shared with the admin which is what I wanted.


2

SP.Site object exposes SP.Site.owner property to get or set the owner of the site collection. REST endpoint: http://<sitecollection>/<site>/_api/site/owner


1

SharePoint 2010 REST Interface expects the following format for the Date column: /_vti_bin/listdata.svc/ListName?$filter=Modified gt datetime'YYYY-MM-DDT12:00:00Z' JavaScript example var listTitle = "Requests"; var minDate = getMinDate(); var endpointUrl = "/_vti_bin/listdata.svc/" + listTitle + "?$filter=Modified gt datetime'" + minDate.toISOString() + ...


1

SP Foundation does not include the User Profile Service, as @Aveenav noted. Therefore you probably do not have access to the REST endpoints for that service. Instead you will have to use the user information list to get this information. This will require two requets: one to get the current user's id, the second to get the user's info that you want. ...


0

1) Get all properties of current user: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties 2) Get single property of current user: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/PictureUrl OR http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl 3) Get Multiple Properties for the ...


1

Mike's alternative is the easiest to implement. You can also implement a Web Service to do the required actions for you and lastly (and I guess what you really want), you can try to implement the calls listed in this article in successive HTTPSend activities. The JQuery version of the REST calls are listed below. // Change placeholder values before you ...


0

For REST api, you could use 'GetMyProperties'. Use '$select' to retrieve only specific properties. the ajax method should be 'GET'. Here's a working example: $.ajax({ url: _spPageContextInfo.webServerRelativeUrl + "_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=DisplayName, PictureUrl", method: "GET", headers: { ...


1

You can't quite impersonate over REST API since the code runs client-side and any user could capture the request and use it maliciously to impersonate the user for other operations. If you have a High-Trust (Provider Hosted) App SharePoint trusts who your signed token claims the user is, but even then, you shouldn't use it client side. You might try using ...


3

It does not seem possible to filter list items using FileSystemObjectType property in SharePoint 2013 REST. Option 1 But you could utilize the following REST query to return folders and associated list items: /_api/web/lists/Lists(guid'GUID')/rootFolder/Folders?$expand=ListItemAllFields JavaScript example var listTitle = "Documents"; var url = ...


0

Try use: /_api/Web/Lists(guid'GUID')/Items?$filter=FileSystemObjectType eq 1 or /_api/Web/Lists(guid'GUID')/Items?$filter=FileSystemObjectType eq '1'


0

I've been able to apply unique permissions on a SharePoint 2013 list item by creating a new SharePoint 2010 workflow. This allows you to use an Impersonation Step. Here is a screenshot of the configuration for this step. As long as you've broken inheritance on your list this should work.


0

Remove the extra "appweburl" on line 4. Your URL will look like "http://servername.comhttp://servername.com/api...." doing it the way you have posted.


0

Here is a technique that will work for any lookup type because it goes to the lookup list for the field you're interested in: You can make a REST request to the /fields endpoint on your list to retrieve some more information about the fields that exist within the list. For your case, you're interested in fields of the person or group type so you could do ...


-1

The datetime value should be in following format $filter=ExpectedDelivery gt DateTime'2012-05-29T09:13:28'


0

In fact the following CSOM examples demonstrates how to upload file those size exceeds 1,5 MB: Example 1 Sub UploadFile(context As ClientContext, sourceFilePath As String, targetListName As String) Using fs As FileStream = New FileStream(sourceFilePath, IO.FileMode.Open) Dim fi = New FileCreationInformation() fi.ContentStream = fs ...


0

Try this //start out by getting a client context for o365 string o365ClientId = "o365ClientId"; string o365ClientSecret = "o365ClientSecret"; //get the Uri for the personal site Uri siteUri = new Uri(siteUrl); //this makes a connection to o365 using an App Only token since the user is not currently connected to o365 //NOTE: The 5 parameter version of this ...


1

Try this var theData = { "propertiesForUser": { "__metadata": { "type": "SP.UserProfiles.UserProfilePropertiesForUser" }, "accountName": "domain\username", "propertyNames": ["CompanyNumber"] } }; var requestHeaders = { "Accept": "application/json;odata=verbose", "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() }; ...


1

It does not seem possible to retrieve Order field using SharePoint 2010 REST Interface. As an alternative approach you could leverage SharePoint Web Services, in particular Lists.GetListItems Method to return list items based on the specified query The following example demonstrates how to retrieve ordered list items using SPServices library: var ...


1

It seems there is no straightforward way to distinguish when using SharePoint 2010 REST Inteface (listdata.svc). You could consider the following solutions that demonstrate how to retrieve Library names Option 1 It consists of: perform request to /_vti_bin/listdata.svc/$metadata endpoint retrieve list/library name from EntitySet element Name attribute ...


3

As said on Twitter. You could first create an empty element with a specific ID. Pass that ID with your ajax call, and once you retrieved the information from your ajax call, you could retrieve the empty element and pass the necessary information in it. This is probably the easiest and quickest way to achieve it.


0

You definitely need an app web, because you need to use SP.RequestExecutor.js to make the cross domain calls using javascript -- this depends on having an app web to perform the cross site communication. Something else worth noting is that the terminology used sometimes can be confusing on the webs... HostWeb: your main SharePoint portal site, where you ...


2

As a workaround, you could fetch the information before the user gets to your list view and store it in sessionStorage... Make the calls to find out if your user is in whatever groups you're trying to look at, then put the result in the sessionStorage object with something like sessionStorage.isInMySpecialGroup = "true" // sessionStorage only wants strings ...


1

Use two quotes. That is for 'aaa'aaa' use 'aaa''aaa'


2

I suppose _vti_bin/ListData.svc and _vti_bin/client.svc (_api) endpoints have different logic for permission checks. I can reproduce your problem, while logged as a site admin I can access the list, but not as a normal user: _api/web/lists/getbytitle('User Information List') What I also have found in the result, is a new (third) link to that hidden ...


0

You can use the property ListItemAllFields as part of the REST URL http://mydev/sites/test/_api/web/getFileByServerRelativeUrl('/sites/test/Shared Documents/Integration.pdf')/ListItemAllFields


0

I also faced a similar issue when I wanted to filter by the Modified field. The following method i developed worked for me: If you are using REST API the datetime literal is used as, e.g. datetime'2013-03-12T12:01:38Z' or datetime'2013-03-12′. Therefore I needed the date in the format yyyy-mm-dd Here is the Code: var d = new Date(); var date ...


0

It turns out that there was a column somehow causing the error. After removing the column from the list, it worked. I don't know why the column would cause that. There is another column of that type (calculated) in the list that doesn't cause listdata.svc to fail.


2

Use Datasheet-View and make Copy+Paste or this Powershell script: Add-PSSnapin Microsoft.Sharepoint.Powershell [System.reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $site = new-object Microsoft.SharePoint.SPSite("SiteURL”) $web = Get-SPWeb -Identity siteURL $lista =$web.Lists["ListName"] $items = $lista.items foreach ($item in ...


1

I came across this scenario a little while back. If i'm not mistaken, I think you will need to 'create' an App Web as a proxy for your REST calls. You also need to alter the AppManifest.xml to add the following entry: <Internal AllowedRemoteHostUrl="~remoteAppUrl"/> in place of <RemoteWebApplication ClientId="*" /> However, this will also ...


0

This issue is resolved .I tracked the requests and responses by SharePointOnlineCredentials class in CSOM using fiddler and followed the same.


0

Your query is wrong. It should be <Where> <And> <Neq> <FieldRef Name='Status'/><Value Type='Choice'>Completed</Value> </Neq> <And> <Neq> <FieldRef Name='Status' /><Value Type='Choice'>Waiting for Inputs</Value> ...


0

Somehow there is an issue reading all of the properties of an account so try to select only what you want like in the url siteUrl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=AccountNamr,Email


1

You can loop using $.each(data.d.results, function (index, task) { for(i = 0; i < task.Status.length; i++) alert(task.Status[i]); });


0

Your processResult function should be like: function processResult(xData, status) { $(xData.responseXML).SPFilterNode("z:row").each(function () { var drpValue = $(this).attr("ows_Name").toString(); var drpValueId = $(this).attr("ows_Name").toString(); ...


0

I have various parameters for testing ODATA API And have tested: "_api/Web/Lists/getByTitle('Documents')/itemcount" result: Is equivalent of "_vti_bin/ListData.svc/Documents/$count" the result is fast and immediate: with this "/_vti_bin/ListData.svc/listname?$inlinecount=allpages" add to result as field called "count", see image below: You can ...


0

I have test your code and I came to a conclusion: As you are developing your app, you need to declare instance of the site context, each time you make an ajax request, try to use the cross-domain, because you are trying to access or post data out of the APP, if you do not will always get those errors. Developed a trivial solution, follows the code below: ...


0

the problem can is here : reader.readAsArrayBuffer(fileInput); where the fileInput is the type of file, if you setting "filelist" you will get file corrupted, check this correctly, converting to "File". An example: var element = document.getElementById("fileInput"); var fileInput = element.files[0]; and add to ajax properties: ...


0

Data corrupted ? the problem is on fileInput: function ProcessUpload(fileInput) reader.readAsArrayBuffer(fileInput); Some point to reflect: But how can you get the fileinput ? if get fileList(files) give error or corrupt, why this parameter is file, only "FILE". And other, i have used RequestExecutor to upload files and not AJAX with JQUERY. But ...



Top 50 recent answers are included