apis
489 TopicsError - Local gulp not found in project directory while running a spfx sample application
Hi I need some help in running a sample SharePoint Framework project. It used to be so easy to develop in Visual Studio since you only had to write some code but VS took care of everything else to build your application from your code. In SPFX you have to manage so many different tools with different versions that sometime it becomes overwhelming. Here are the details of my environment. 1) Node.js v 8.11.4 2) spfx - 1.7.0 (Sample application) 3) gulp CLI version 2.0.1 (Global Install) I have done a "npm install" to install the dependencies for the project. However when I try to run the application, I get an error " Local gulp not found in project dir". Try running : npm install gulp. I tried the suggested command "npm install gulp" to do the local install of the gulp even though I have the global install of the gulp. This did not help. I looked at the node_modules in the VS code and I cannot decode it to understand if gulp is there in the local dependency list or not. I have tried google and everyone has a different suggestion to solve this problem. Nothing seems to help. If someone can give me a tip or share their experience, I will really appreciate it. Thanks in advance -ArunSolved37KViews0likes6CommentsPnP-PowerShell Connect-PnPOnline using AppId gives Access denied
I'm creating a PowerShell script to connect to SharePoint Online and authenticate as a registered Azure AD application (not a user). In Azure AD I have registered the application and I have the AppId and AppSecret. Through Azure AD I have granted the application API access to the SharePoint Online API with the application permissions 'Have full control of all site collections' and 'Read and write managed metadata'. I have also performed admin consent for the app by going to the URL: https://login.microsoftonline.com/<tenant>.onmicrosoft.com/oauth2/authorize?client_id=<client id>&response_type=code&prompt=admin_consent. When I use the cmdlet: Connect-PnPOnline -Url $siteUrl -AppId $appId -AppSecret $appSecret no message is displayed as if the connection occurs properly. However, when I use ANY cmdlet (i.e. Get-PnPWeb) I receive 'Access denied. You do not have permission to perform this action or access this resource.' Any help is appreciated.Solved32KViews0likes6CommentsSharePoint 2016 REST API: query filtered by ContentType
Hi, We're testing that our product properly supports SharePoint 2016, but we're having a problem with queries. We've been using the REST API to retrieve the items from a list, filtered by type, as follows: {server}/_api/lists(guid'29ca29ac-d10e-4285-9a80-9ed5c58cc0d6')/items?$filter=ContentType%20eq%20%27Task%27 In other words, filtering with the query "ContentType eq 'Task'". This worked with the 2013 version of the server, but the 2016 sever returns a 500 error: Internal Server Error: Column 'ContentType' does not exist. It may have been deleted by another user. tel:(214)%20623-2832, Microsoft.SharePoint.SPException) We found that filtering by ContentTypeId (with a query such as "ContentTypeId eq '0x0108002840D046B700484FAC17F0F83950DFD7'") achieves what we want, but were hoping for a solution closer to the original, since using ContentTypeId is hard to read. Is there a way of filtering by content type like what we did before? Thanks!20KViews1like8CommentsHow to create Team Site with REST API
Hi Guys, I have been searching all over the place to find information about a "simple" task I want to do with REST API. I want to create a new Team Site... I have found this endpoint which lets me create a communication site, but why is there no such thing for Team Sites? "/_api/sitepages/communicationsite/create"Solved16KViews0likes3CommentsSharepoint online - search/rest api -filter results in URL
I've got this piece of code to query a certain content type: var results = []; $.ajax({ url: "https://blabla.sharepoint.com/_api/search/query?querytext='ContentTypeId:0x0100AEC702D446F8F04696C2B7573837C451*'&trimduplicates=false&rowlimit=500&selectproperties='FullName%2cWorkHours%2cWorkDate'", method: "GET", headers: {"accept": "application/json;odata=verbose"}, success: function(xData, request){ results = xData.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results; This is working fine. But, as you can see it gives me all records (which can be a lot). In my current solution I build an If statement to filter "FullName" on the Current User. It works but performance wise is doe not seem the best solution. So I would like the initial query to give me only the records of the current user. I tried several queries like this: url: "https://blabla.sharepoint.com/_api/search/query?querytext='ContentTypeId:0x0100AEC702D446F8F04696C2B7573837C451*'&trimduplicates=false&rowlimit=500&selectproperties='FullName%2cWorkHours%2cWorkDate'?$filter FullName eq CurrentUser", In all kind of different ways. But no luck so far. When I have this in place I also would like to aggegate the hours per day. But that will be phase two ;-) Can someone help me out?15KViews1like4CommentsSharePoint Webhooks -- now Generally Available!
Hello everyone, Just wanted to announce that SharePoint Webhooks is now Generally Available. First announced https://dev.office.com/blogs/sharepoint-webhooks-developer-preview-now-available in September, Webhooks https://dev.office.com/blogs/sharepoint-webhooks-is-now-generally-available-build-service-oriented-processes-in-sharepoint. Webhooks are based on industry standard patterns around how services fire notifications that developers can intercept and react to. In particular, within SharePoint we've added support for webhooks against SharePoint list data, including events like Item Added, Updated, and Deleted. A developer could then choose to kick off a process, or programmatically update a document, or fire off a tailored notification to users using information you can get from webhooks. You can find an end-to-end overview and "getting started" with webhooks https://dev.office.com/sharepoint/docs/apis/webhooks/overview-sharepoint-webhooks. Look forward to seeing what you all build with these! -- Mike Ammerlaan, Office Ecosystem Marketing team15KViews20likes13Commentsspfx React > REST API > Map search results
I have a woking example where I map (rest) search results to an object like this: export interface IReactGetItemsState{ items:[ { "EmployeeName": "", "EmployeeId": "", "Experience":"", "Location":"" }] } export default class ReactGetItems extends React.Component<IReactGetItemsProps, IReactGetItemsState> { public constructor(props: IReactGetItemsProps, state: IReactGetItemsState){ super(props); this.state = { items: [ { "EmployeeName": "", "EmployeeId": "", "Experience":"", "Location":"" } ] }; } ----------------------------------- jquery.ajax({ url: `${this.props.siteurl}/_api/web/lists/getbytitle('EmployeeList')/items`, type: "GET", headers:{'Accept': 'application/json; odata=verbose;'}, success: function(resultData) { reactHandler.setState({ ----> items: resultData.d.results Now I want to do my own variant using an Ajax call using a querystring. So my result object is different I try to map the results in this way: items: resultData.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results.Cells This is not working. My results remain empty. I'm just beginning SPFX/React so I do not know how to solve this. Can someone help me out? Thanks, MikeSolved14KViews0likes34Comments