PnP Modern Search
11 TopicsToday query in SharePoint Search not working anymore
Has anyone else had an issue with a query like RefinableDateXX={Today} not work for them anymore as of a few days ago? I've had a query i've been using for a few years and all of a sudden the items from a SharePoint list with a date field linked to a RefinableDate managed property no longer returns results for {Today}. I've had to use {Today-1} or {Today+1} but even that has been hit or miss. Especially when using an AND or OR for multiple dates or date ranges. Just wondering if i missed an update MS made or if something is broken.1.9KViews1like2CommentsPnP Modern Search - Query Term - Search Hub and Associated Sites
Hi, I have created an Advanced Search page with PnP verticals that I would like to search individual hubs and their associated sites. For example my verticals are as follows: All Hubs, Knowledge Hub&Associated Sites, Communities Hub, Colleague Hub The Knowledge Hub is the only one that has 30 plus associated sites and I would like to enter some query text in for the Knowledge Hub results to return results for that hub and all 30 sites. Does anyone know what the query looks like for this? I thought it was would be this: {searchTerms} RelatedHubSites:{Hub.Id} but this only works on the hub where the search page has been developed, I am hoping there is away to look across another Hub in a separate site collection? ThanksSolved4.6KViews0likes5CommentsPnP Modern Search Filter - Managed Metadata fields display additional properties
The PnP Filter webpart uses the managed Property "RefinableString01" mapped to a "Fiscal Year" term set. There are additional properties being displayed that may seem confusing to end user and we would like only to display the years. There is a description of the Property bag properties values. https://microsoft-search.github.io/pnp-modern-search/usage/search-filters/5.2KViews0likes4CommentsRefinement filters syntax in SharePoint
Hi there Recently, I created a SharePoint page, which uses PnP modern search v4 web parts. I have a PnP - Search field and PnP - Search results . They are both connected together. Note: all pages and documents are stored on my company's SharePoint domain. Originally In the PnP - Search results web part, Refinement filters was empty. When I typed in a search term and clicked [enter] or right arrow (>) button, it brought up all pages where the search term is in the page title, or in the page content. My Requirement Search for a web page where the page Title or page content contains searchTerms inputted in PnP - Search field . When Refinement filters, I noticed that it says "ex.: FileType:equals("docx") " Currently In the PnP - Search results web part Refinement filters used currently: FileType:equals("aspx") and Title:ends-with(searchTerms) After saving this as a draft, when I type in a page to search for, e.g., "Amanda", the only result that comes up is a Word Document, that contains her name. No pages appear in the search Results at all. I did some searching on the internet and found FAST Query Language (FQL) syntax reference: https://learn.microsoft.com/en-us/sharepoint/dev/general-development/fast-query-language-fql-syntax-reference . So I understand that I am using the right syntax for 'FileType:equals("aspx")', and Title:ends-with(searchTerms), when I just have one of those filters. My Question What syntax should I use when I want the Refinement filters to include 2 filters? Another links I have looked at What is the difference between Query text and Refinement filters: https://learn.microsoft.com/en-us/answers/questions/640137/what-is-the-difference-between-query-text-and-refi.html Note: Apologies for the lack of images. At the moment when I try to insert an image it says "You do not have permission to upload images." Regards, George18KViews0likes1Commentpnp search results webpart display manager
Hi, I'm trying to use pnp search results to create a customized staff directory. I'm so close to how I want it to look but I can't get the Manager property to display correctly. I mapped People:Manager to RefinableString01 and it does display but as an account name, like i:0#.f|membership|user@email.com Is it possible to show the manager as displayName?1.2KViews0likes1CommentResult search query to exclude items without values in a managed property
Hi all, I am trying to configure a PnP Search Results WebPart to show all recently modified site pages that contain a value in a managed property, any value that isn't blank. For context, this is for a wiki SharePoint site where all users can make changes and submit for approval. After they are approved, I would like to show on the home page the most recently updated pages. What I would like the query to do: Search for all pages from the path below that contain any value in the RefinableString00 property. path:https://xxx.sharepoint.com/sites/wiki/ A refinement filter is also set in the WebPart so that results only show site pages: FileType:aspx Results are also sorted to show the most recently updated pages first, using the property: LastModifiedTime My issue is that there are pages that don't have a value in the managed property RefinableString00 showing. I would like for these pages to not show. The question being how would I achieve this? Any suggestions would be appreciated5.5KViews1like2CommentsWhat is the syntax for conditional formatting within PnP Modern Search WebPart template?
Hello, I am trying to figure out the syntax for the PnP Search WebPart so that I may apply conditional formatting. In this case, I would like to see if a column value is empty - then I would apply X CSS and if a column value's length is less than 2 , then apply this Y CSS. Conventionally, I would imagine it would be something like this if the value is empty : {{#if slot.item root.,slots.Title.value empty}} <div>..CSS here </div> {{/if}} AND something like this if the string length is greater than 2 : {{#if slot.item root.,slots.Title.value >len(2)}} <div>..CSS here </div> {{/if}} I would very much appreciate any assistance. Regards, Mike1.3KViews1like0CommentsModernization: _'0x0D' is invalid within a JSON string. The string should be correctly escaped.
Problem Area Page Transformation: Error during the use of page transformation from PnP PowerShell Expected or Desired Behavior ConvertTo-PnPPage PnP PowerShell command should modernize the web part pages having script editor web parts. It should convert classic OOB script editor web parts to configured react script editor web part. PnP PowerShell Online Version Details: Name: SharePointPnPPowerShellOnline Version: 3.29.2101.0 Observed Behavior Getting the below error while trying to modernize the page with script editor web part: '0x0D' is invalid within a JSON string. The string should be correctly escaped. Path: $ | LineNumber: 0 | BytePositionInLine: 317. at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& readStack, JsonReaderException ex) at System.Text.Json.JsonSerializer.ReadCore(JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& readStack) at System.Text.Json.JsonSerializer.ReadCore(Type returnType, JsonSerializerOptions options, Utf8JsonReader& reader) at System.Text.Json.JsonSerializer.Deserialize(String json, Type returnType, JsonSerializerOptions options) at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options) at PnP.Core.Model.SharePoint.PageWebPart.set_PropertiesJson(String value) at PnP.Framework.Modernization.Transform.ContentTransformator.Transform(List`1 webParts) at PnP.Framework.Modernization.Transform.PageTransformator.Transform(PageTransformationInformation pageTransformationInformation) Page Transformation Settings Property Setting Engine version 1.9.1.0 Target Page Takes Source Page Name False Target Page Prefix Migrated_ Source Page Prefix Previous_ Copy Page Metadata True Set Author In Page Header False Replace Home Page With Default Home Page False Overwrite True Target Page Name Target Page Folder Target Page Folder Overrides Default Folder False Keep Page Specific Permissions False Remove Empty Sections And Columns True Handle Wiki Images And Videos True Add Table List Image As Image Web Part False Keep Page Creation Modification Information True Publish Created Page True Post As News False Disable Page Comments True Skip Url Rewrite False Skip Default Url Rewrite False Url Mapping File Skip Hidden Web Parts False Term Mapping File Skip Term Store Mapping False Skip User Mapping False User Mapping File L D A P Connection String Skip Telemetry False Transformation Operation Details Note: It is similar to issue https://github.com/pnp/modernization/issues/url It is working fine if I remove the newline character from the script. But for us it is a lot of pages and will not be feasible to manually remove the newline character from each script. Is there any alternative solution to fix this issues for all of the pages. Steps to Reproduce Install the react-script editor web part to the app catalog from the link https://github.com/pnp/modernization/issues/url Create a web part page in a classic SharePoint site, add OOB script editor web part and add the below sample script in the code snippet of the script editor web part. Sample Script: <h1>My First JavaScript</h1> <button type="button"onclick="document.getElementById('demo').innerHTML = Date()">Click me to display Date and Time.</button> <p id="demo"> </p> Then use the below script to modernize the page with the switch -UseCommunityScriptEditor: ConvertTo-PnPPage -Identity $page.FieldValues["ID"] -Overwrite -DisablePageComments -AddTableListImageAsImageWebPart: $false -ClearCache -SkipItemLevelPermissionCopyToClientSidePage -TakeSourcePageName:$TakeSourcePageName -LogType File -LogFolder $LogOutputFolder -LogVerbose -LogSkipFlush -KeepPageCreationModificationInformation -UseCommunityScriptEditor -CopyPageMetadata25KViews0likes0CommentsSharePoint Online - PnP search v4 - List item - result display
Hi all, Hope you are all doing great. Having one question regarding PNP search v4. I managed the configure most of the stuff but there is one issue that I am not sure how to resolve. The idea is to search items from the Sharepoint list which is formatted in a specific view. When the search is done (I am using the search box and search results, nothing else), it shows these items which is great. However, the issue that I am having is that it opens the item in DispForm.aspx form, which is not the view I want for users to use. Is there a way to resolve this issue (without affecting other sites)? Also, I used the following line for searching the list for results Query template {searchTerms} path:https://domainname.sharepoint.com/sites/SiteName/Lists/ListName/ Result Source Id / Scope|Name LocalSharepointResults Any help would be deeply appreciated. Thanks.3.1KViews0likes0CommentsRedirecting search queries to PnP Modern Search results page only fires once
Hello, based on Mikael Svensons Ignite presentation I was eager to learn that you can redirect search queries to a PnP Modern Search results page. Has anyone encountered the issue that it only works for the initial query? So from site collection A I'm entering a query that is passed on to site collection B which hosts the results page. The parameters passed are searchResults.aspx?k=test&ql=2055, for example. I have configured the result source web part to use the page environments query parameter k. The search results web part correctly shows hits for the query. However, I can't get a new query to fire. When I use the out of the box modern page's search box the url in the address bar changes but it's not passed on to the search results web part: When I refresh the browser page the new query is passed on and the web part shows the new results. Is anyone experiencing this behaviour? I though of putting a PnP Modern Search box onto the page for further queries but the results web part can only be connected to one source it seems. Thanks.4.7KViews0likes1Comment