Domanda

I am after a solution where a user can search for an inducted user (Just a String using Title field), once the search results are returned the user can click on the returned search results title and then be taken to all results related to that user.

Example, Inductee List contains a user named 'Greg Smith' (Title Field), another List named Inductions contains a Lookup to the Inductee Lists Title field. When a search is performed on Greg the results return several list items named Greg, the user could then click on Greg Smith and be shown the entries from the Inductee list and inductions list just for Greg Smith.

Is this possible or is there another approach I can take?

Using SharePoint Online, Modern Experience.

È stato utile?

Soluzione

You can do this quite easily if you understand how to change the search rendering in the UI. You say you are using the "Modern Experience" so I would suggest you look into the PnP Modern Search web parts. Here is a thumbnail of how you do this:

  1. Optional, but it makes the initial query way easier, make inductee a content type.
  2. Tag all relevant data with a person field (eg. InducteeName) if Greg Smith is part of your tenant org. If not then you may want to use Text or MMS depending on your needs. Make it a Site Column if you are using it on several lists.
  3. Create a Managed Property (eg. InducteeName) for the field above. (I would use a Refinable field)
  4. Create two Search Pages (you can do it with one, but I'd start with two for simplicity)
  5. On the first page the search results web part craft the query like ContentType=Inductee Title:{query} or similar. This way you only get inductee results and hits from the title field. (My syntax may not be perfect, but you get the idea. If you are not using a content type, you'll have to use Path)
  6. Change the results rendering for the link on the title field. This will be the URL to the second results page with a query appended to it something like k="InducteeName={the title field value}"

This is all easy in the traditional SharePoint Search Center using display templates and query rules. Sadly, in Modern, these features are not available without the PnP. NOTE: All queries are approximations. You'll have to mess with them to get it just right.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top