Posts

SharePoint 2013/ Office 365: SharePoint designer workflow fails to assign task to SharePoint group.

I faced the weird issue, that SharePoint designer workflow which we have created to assign task to all the members of the SharePoint group. Which was working fine for some group and suddenly started failing for the newly created SharePoint group. I spend some time on research , debugged the workflow no luck there, then at last thought to compare the group settings as it works for few. That did a trick and come to know that relation of Group Visibility settings in SharePoint workflow. If the Group Visibility is set to "Group Members" - Workflow will fail for this group, it will not assign the tasks or other group related operations will fail. Workflow requires to have Group Visibility set to "Everyone". else it will fail. I came to know two scenarios where it fails if visibility is not "Everyone" 1. When we assign task to SharePoint Group. 2. When we try to check from workflow that user belongs to particular SharePoint group or not. I hope th...

SharePoint Online / Office 365 : Steps for Adding Search Result Webpart in Pagelayout

Image
Recently, while working on a SharePoint online project I faced the requirement to add the Configured Search result webpart in PageLayout. Which should show the result based on the one of other taxonomy field on the page. Steps to include the Search Result Webpart in Pagelayout: 1.Create one page and configure the Search Result Webpart there. (Tip: Create the separate result source, so no dependency on changing the query later in pagelayout if any modification.) 2. Export the webpart, open the exported file in any editor. Which will look something like below image. We will require all these property value to configure the webpart in layout. 3.  Create the page layout and set up the basic design. 4.  Register the following assembly at the top of your Pagelayout. < %@ Register Tagprefix = "SearchWebControls" Namespace = "Microsoft.Office.Server.Search.WebControls" Assembly = "Microsoft.Office.Server.Search, Version=16.0.0.0, Culture=neutral,...

Step by Step SharePoint Framework setup with Angular2

Image
I started trying the  new SharePoint Framework (SPFx), which looks quite promising. let’s start to setting up a SPFx project that uses Angular 2. Prerequisites  to configure/setup the development machine :  link Step 1: In cmd, Navigate to the directory where we want to create our project. Step 2: Run the command " yo @microsoft/sharepoint" Step 3: Now we need to follow the instruction given in  SharePoint Client-side Solution Generator   Step 4: Here at this stage we need to select the JS framework. there is possibility to select the out of the box framework supported. however to use the Angular 2 as our JS Framework we need to select the "No javaScript web framework" Step 5: Now installation and configuration will start, it will take sometime to complete. Once that done, will get the success message. Step 6: Now to start the local web server, run this command: gulp serve Step 7: At this point it b...

Search Result Webpart,Filter result If QueryString is present in URL

Image
There was a requirement to filter the search result based on QueryString present in url, and if no QueryString present then should populate all the results. Issue was simple to resolve if every time there is QueryString present, then below Query will do the job. Below filtering the result by checking managed metadata property equals the query string value. Above query was filtering the result based on QueryString given in URL. However it fails if there is no QueryString present in url.  "No result found" message appear. Ideally should populate all the results. And filter should be optional in query for this scenario. So I need to modify the query and to add some condition like, if QueryString present then check managed metadata property equals the query string value, else no. To achieve this, there is syntax  {searchboxquery} {? <some KQL expression> } , If MyParameter querystring is not present in URL,  then just first part of KQL query wi...

Search Query by ContentType name issue

I ran into very weird issue in SharePoint Search while querying the items using ContentType name. Query: ContentType={content type NAME} This was giving me the result of content type, however some extra data/results where coming along in the result. There was no clue what is failing there. Spent few hours and got very useful tip from Search Guru,  MIKAEL SVENSON   that not to use ContentType but to replace that with  SPContentType. Modified Query: SPContentType={content type NAME} Learning: We should use SPContentType instead of ContentType. As Contenttype also includes the mime type and not just the name and may cause issues. SPContentType only stores the name. I hope this small piece of information will save your time!

SharePoint Online - Get workflow status in List Item using PowerShell

Requirement was for SharePoint online tenant to get the workflow status in list item. I choose to write quick PowerShell script using CSOM to achieve this. [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") Function Get-SPOCredentials([string]$UserName,[string]$Password) { if([string]::IsNullOrEmpty($Password)) { $SecurePassword = Read-Host -Prompt "Enter password" -AsSecureString } else { $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force } return New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword) } Function GetWorkflowStatus([Microsoft.SharePoint.Client.List]$list,[int]$listItemId, [string]$workflowName) { $context = $list.Context $listItem = $list.GetItemById($listItemId) $context.Load($lis...

Get SharePoint Document Library Size using PowerShell

There was requirement to get the document library size. Using PowerShell I able to resolve this requirement. This post is about getting actual Document Library size using PowerShell. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 Add-PSSnapin Microsoft.SharePoint.PowerShell $siteURL = "YourSitename" $site = new-object Microsoft.SharePoint.SPSite( $siteURL ) foreach ( $web in $site .AllWebs) { foreach ( $list in $web .Lists) { if ( $list .BaseType -eq "DocumentLibrary" ) { $listSize = 0 foreach ( $item in $list .items) { $listSize += ( $item .file).length } "Web Name: " + $web .Title+ ", Library Name: " + $list .Title+ ", Size: " + [Math] :: Round(( $listSize /1KB),2)+ "KB" } } } I hope this small script will save your time.

Query User Information List gives :Error 404 List Not found- SharePoint 2013

Being a SharePoint developer we all know that  The User Information List stores information about a user by having some metadata set up for the user. Some examples are Picture, Email, DisplayName, LoginName etc. )  This list is only visible to and accessible by administrators. However today we faced very weird issue that not able to access this hidden list. we can browse it under  " /_catalogs/users" but we were not able to query it Problem :   We were not able to query the User Information List in SharePoint 2013 On-Premise. Tried following stuffs : 1. http://your-site-name/_vti_bin/ListData.svc/UserInformationList 2.  http://your-site-name/ /_api/web/lists/GetByTitle(‘ User Information List ') 3. In PowerShell -   $SITE = GET-SPSITE "HTTPS://your-site-name" $WEB = $SITE.ROOTWEB $LIST = $WEB.LISTS["USER INFORMATION LIST"] All the above was giving the 404 error, List was not exist under the $web.Lists - which was very w...

Office 365 People Search:Hide default result

Out of the box, People search result webpart shows the list of people as a result. However, I had a requirement to remove the default people search coming in result webpart when page loads. with the default query : - {searchboxquery}contentclass=spspeople -accountname:rapidcircle.in Spent few hours to find the solution finally got this useful tip from my Search guru   MIKAEL SVENSON To remove the default result need to bind the query with {?<query>} the {?{searchboxquery}} will remove everything in the query if the {searchboxquery} variable is empty Hope this small piece of information will save your time.

Permission denied for "Add and Customize Pages" in Sharepoint Online

Image
Problem: I have created root site in SharePoint Online, weird problem I started facing is being a site administrator I was not able to customize the page/ upload the any page or master page. As in image below, for some reason I am set as Deny to "Add and Customize Pages". The problem is related to 'Scripting Capabilities' being turned off by default for the root site collection in Office 365. I found some article on community: https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f?ui=en-US&=amp&rs=en-US&ad=US It mentions that turning on scripting through the Sharepoint Admin Settings and wait around 24 hours. However, this did not work for me. still the issue was there. Following lines of script did a trick. Solution: Connect-SPOService -Url https://<yoursitename>-admin.sharepoint.com -credential <admincredentials> Set-SPOsite https://<your root site ur...

Display Template HTML file missing in SharePoint online

Today was trying to work on the display template in SharePoint Online. As documented every where, that can go to Site Galleries->Master Page->Display Templates :     <your site url>/_catalogs/masterpage/Forms/AllItems.aspx and display templates folder, to get the existing templates. However, I was just seeing all the .js files not the HTML where I supposed to work. Finally found the cause is Publishing Feature. Solution: We must turn on SharePoint Server Publishing Infrastructure feature in the Site Collection Features. for the HTML pages to show up, from there we can edit the HTML files and create new display templates. This is not documented any where. Hope small tip will save your time!

Nintex 2013 Workflow Action: "Commit pending changes"

Image
Commit pending changes is not well known action of Nintex, However very useful when you have scenario like I faced.  I had a requirement like first to update the list item, and immediately need to take the count of updated items. I spent quite amount of time to achieve this, First tried by doing simple workflow 1. Update list item 2. Query list (query the same list which updated) Here after running this, started getting uncertain results. Sometime it works and fails. Started applying workarounds to that Tried to apply “Pause for” action in between, like below image. Result was again uncertain, it pause was getting struck, was not resuming the workflow even after specified time. I goggled and found many issues are reported for the same issue, https://community.nintex.com/thread/2979 Third workaround was to add some loop which can add some pause before query, somehow even after safe loop, result was uncertain. Finally found the impressive feature of Ni...

Nintex 2013: Show display name in email notification for person field

Image
In Nintex 2013, requirement was to show the user's "Display name" in email. looks a very simple issue by looking at the definition. However, to achieve this in workflow have to choose proper way to implement. Two options are available to get this. 1. Using "Call web service" action 2. Using " Query user profile" To move ahead with first step, we need to use Regular expression, web service and query xml  as described here in  https://community.nintex.com/thread/1353  lots of configuration require to make this work. as well to store credentials of admin to call the web service, need to make the constant in Nintex management. So In my implementation, I choose second option, fairly simple to use. Steps to use "Query user profile" action to get display name: 1. Add "Query user Profile" from actions tab  2. Double click to configure it, and select the person field , here selecting "Created By" field of t...

SharePoint 2013 List CRUD operation using Angular and REST API

Image
This article explains how to perform the CRUD operation on a SharePoint List using Angular JavaScript and the REST API. Create an empty SharePoint 2013 solution, In that add the module of Pages, JS & CSS. In pages module add new item, Test.aspx. In JS module, add new Javascript file with name Controller.js , CommonServices.js &  SharePointListModule.js Other Javascripts needs to add: 1.  angular.min.js 2. anugular.min.js.map Project structure will look something like below: In SharePointListModule.js will create a App of angular, Paste the below code. //App creation var app = angular.module("SharePointAngApp", []) For doing a CRUD operation with SharePoint List, will create an Angular Service to make a SharePoint REST API calls, app.service('testService', ['$http', '$q', function ($http, $q) {//common services}]); This testService having dependency of $http & $q Information related to $http & $q   ...

“Response no longer required” error in nintex workflow

Image
Error:  “Response no longer required” With Nintex , requirement was to create a workflow which passes through multiple approval process. Workflow having Felxi tasks with customized task forms. After publishing everything works well in development environment. Time was to deploy the workflow at test environment, deployed workflow with manual import/export published it no error reported, its published successfully. When first approval task starts, it started giving email notification something like below: "Response no longer required" A task regarding this item no longer requires your response: ItemName Click here to view the workflow status First was not sure, from where this notification coming up from workflow steps, as I haven't set any message like this in workflow,  No error reported in workflow tasks, or in workflow history. Invested almost a whole day to find the exact cause. Finally found in flexi task configuration window under ...

Nintex Forms: Cannot open designer "An error occurred during an ajax call."

Recently I have installed the Nintex Workflow Forms and configured it. I have activated the web application feature and site collection features and all, however when I try to customize a list forms using Nintex designer I started getting error message that says  "An error occurred during an ajax call." When I did IISReset, it seemed to have fixed it. hope this small piece of information will save your time!

Nintex Workflow 2013, unable to publish workflow : soap:serverserver not able to process request object reference not set

Image
Being a newbie with Nintex, I have installed and configured Nintex Workflow and Nintex Workflow Forms. easy to follow all the steps described on Nintex support page. After doing all the necessary configuration, tried to create very simple one step workflow to test. There I faced weird issue, I was able to save the workflow, however while publishing it was giving below error. Error was very generic, wasted couple of hours to find the exact cause as in workflow logic there was nothing. simple one step workflow it was. So pointer was going to configuration only, something in configuration is not proper which throwing this error. Solution : 1. Go to Central Admin 2. Click on Nintex Worklfow Management 3. Database setup -> Add Content Database ( I already configured it, still created new) 4. Configuration Database click Edit 5. Update the connection string with newly created database. 6. IISRESET And we are good to go. Hope this will save you...