microsoft-search / pnp-modern-search

Home of PnP Modern Search solutions, helping you move from classic to modern SharePoint and beyond
https://microsoft-search.github.io/pnp-modern-search
Other
388 stars 341 forks source link

Not able to retrieve custom field data from SPO list #4058

Closed AllanMacAshurst closed 3 weeks ago

AllanMacAshurst commented 1 month ago

We have installed PNP Modern Search Web Parts in an attempt to build custom list search / filter capability and configured it as per guidance, see below: image

However when we view in debug mode the search output, it returns null for the various fields we want to filter against

Version used Ex: 4.8

Describe the bug When setting Selected Properties in search results web part, it returns null for most fields and for URL field returns wrong value

To Reproduce Detailed steps to reproduce the behavior:

  1. Install PNP Mopdern Search web parts to tenant and then site
  2. Add Search Input and Search Results to page
  3. Set Query template uto target list items
  4. Add Fields to be returned in list view
  5. Get nulls in debug view

Expected behavior We expected that the values for each item with include the list item values for configured fields

Screenshots image

Desktop (please complete the following information):

Additional context

kasperbolarsen commented 1 month ago

Can you check if you get any results using one of these debugging tools, https://microsoft-search.github.io/pnp-modern-search/using-query-tools-to-verify-issues/

AllanMacAshurst commented 1 month ago

I'll give them a try, but we are able to get data back from list using pnp js in spfx

Allan MacRitchie (He/Him/His) Senior SharePoint Microsoft 365 Developer


Central Exchange, 20 Waterloo Street, Glasgow, G2 6DB D: +44 141 375 4741 www.ashurst.comhttp://www.ashurst.com [Ashurst] is outpacing change with clients. Find out howhttps://www.ashurst.com/en/outpacing-change?utm_source=esig_text&utm_medium=email&utm_campaign=BrandLaunchExt&utm_content=signature_text_1.

Visit our Powering Changehttps://www.ashurst.com/en/powering-change-technologies-fuelling-the-future-report?utm_source=edm&utm_medium=email&utm_campaign=PoweringChange24&utm_content=Email_Signature webpage for insights on the technologies fuelling the future.

From: Kasper Larsen @.> Sent: Friday, October 18, 2024 2:44 PM To: microsoft-search/pnp-modern-search @.> Cc: MacRitchie, Allan 14741 @.>; Author @.> Subject: Re: [microsoft-search/pnp-modern-search] Not able to retrieve custom field data from SPO list (Issue #4058)

Caution: External email.

Can you check if you get any results using one of these debugging tools, https://microsoft-search.github.io/pnp-modern-search/using-query-tools-to-verify-issues/https://microsoft-search.github.io/pnp-modern-search/using-query-tools-to-verify-issues

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft-search/pnp-modern-search/issues/4058#issuecomment-2422511204, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3KEU4THMSGGTO7YGZ6L5HDZ4EGCDAVCNFSM6AAAAABQFZIDJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRSGUYTCMRQGQ. You are receiving this because you authored the thread.Message ID: @.***>

This email (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately. Please then delete the email and do not disclose its contents to any person.


This email (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return email. Please then delete both emails and do not disclose their contents to any person. We believe, but do not warrant, that this email and any attachments are virus free. You should take full responsibility for virus checking. Ashurst reserves the right to monitor all email communications through its networks. If the content of this email is personal or unconnected with our business, we accept no liability or responsibility for it.

Ashurst LLP is a limited liability partnership registered in England and Wales under number OC330252 and is part of the Ashurst Group. It is a law firm authorised and regulated by the Solicitors Regulation Authority of England and Wales under number 468653. A list of members of Ashurst LLP and their professional qualifications is open to inspection at its registered office: London Fruit & Wool Exchange, 1 Duval Square, London, E1 6PW. The term "partner" is used to refer to a member of Ashurst LLP or to an employee or consultant with equivalent standing and qualifications. Further details about Ashurst can be found on our website at www.ashurst.com.


kasperbolarsen commented 1 month ago

That is far from the same 😉

Those fields, are they site columns or list columns?

AllanMacAshurst commented 1 month ago

They are list columns

Allan MacRitchie (He/Him/His) Senior SharePoint Microsoft 365 Developer


Central Exchange, 20 Waterloo Street, Glasgow, G2 6DB D: +44 141 375 4741 www.ashurst.comhttp://www.ashurst.com [Ashurst] is outpacing change with clients. Find out howhttps://www.ashurst.com/en/outpacing-change?utm_source=esig_text&utm_medium=email&utm_campaign=BrandLaunchExt&utm_content=signature_text_1.

Visit our Powering Changehttps://www.ashurst.com/en/powering-change-technologies-fuelling-the-future-report?utm_source=edm&utm_medium=email&utm_campaign=PoweringChange24&utm_content=Email_Signature webpage for insights on the technologies fuelling the future.

From: Kasper Larsen @.> Sent: Friday, October 18, 2024 4:47 PM To: microsoft-search/pnp-modern-search @.> Cc: MacRitchie, Allan 14741 @.>; Author @.> Subject: Re: [microsoft-search/pnp-modern-search] Not able to retrieve custom field data from SPO list (Issue #4058)

Caution: External email.

That is far from the same 😉

Those fields, are they site columns or list columns?

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft-search/pnp-modern-search/issues/4058#issuecomment-2422765367, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3KEU4WUCJJDMBDAWKMTEHLZ4EUOFAVCNFSM6AAAAABQFZIDJGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRSG43DKMZWG4. You are receiving this because you authored the thread.Message ID: @.***>

This email (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately. Please then delete the email and do not disclose its contents to any person.


This email (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return email. Please then delete both emails and do not disclose their contents to any person. We believe, but do not warrant, that this email and any attachments are virus free. You should take full responsibility for virus checking. Ashurst reserves the right to monitor all email communications through its networks. If the content of this email is personal or unconnected with our business, we accept no liability or responsibility for it.

Ashurst LLP is a limited liability partnership registered in England and Wales under number OC330252 and is part of the Ashurst Group. It is a law firm authorised and regulated by the Solicitors Regulation Authority of England and Wales under number 468653. A list of members of Ashurst LLP and their professional qualifications is open to inspection at its registered office: London Fruit & Wool Exchange, 1 Duval Square, London, E1 6PW. The term "partner" is used to refer to a member of Ashurst LLP or to an employee or consultant with equivalent standing and qualifications. Further details about Ashurst can be found on our website at www.ashurst.com.


AllanMacAshurst commented 1 month ago

I appreciate they are far from the same, Unfortunately I am unable to use the search tool, I will try the Chrome addin shortly

kasperbolarsen commented 1 month ago

In general we recommend using Site columns as the search index will create managed properties for site columns, unlike list columns where you will have to connect the crawled properties to a managed property your self

codingsisya commented 1 month ago

As @kasperbolarsen said, use Site Columns and map to RefinableString if you intend to use those columns as Refinement filters

kasperbolarsen commented 1 month ago

In general I recommend reading https://learn.microsoft.com/en-us/microsoft-365/community/how-do-site-columns-become-managed-properties-thus-available-for-search

Carefully, as requirements like thare have to be a value in the column in order for it to picked up by the index. Likewise, the requirement that you have to be a Site collection admin on a Team site is also tripping a lot if people