Thursday, December 29, 2022

Deploy a custom Form Formatting as part of your Site Provisioning

 

Sometimes the default list "new Item"/Edit form is just not well suited as the number of fields causes the form to start scrolling and thus hiding some of the fields.




In the dark ages the default option was to use SharePoint Designer to modify the forms 😟, but today we have more choise based on your needs: 

  • Are you limited to only use out of the box SharePoint
  • Do you need to have logic in the form like if you entered option A in a field  then the options in the next field must be limited to a specific subset of options.
  • Should this list be provisioned to new Site Collections using a provisioning engine

If you need logic between the fields you will most likely choose to customize the list using PowerApps , however as far as I know is is not possible to deploy the PowerApp customization on multiple site collections.


If however you can do without the logic the most likely choice is to use Form Formatting  This will enable you to use the entire screen for your form and manage both the header, body and footer. The body can segregated into sections, making it easier for the end user to locate the fields:



        The PnP community maintains a repository of Form samples if you need some inspiration.



Once you have completed the Form customization it is time to extract it. The JSON configuration is a property on the Content Type, and the PnP sample provided by Kinga Kazala shows how to extract the JSON to a file.


Store the JSON file in SharePoint, setup an Azure Function as I have shown in the sample here, and you are done 👌

Wednesday, December 21, 2022

Yeah, SharePoint custom Search Display Templates are back*



Once upon a time (before SharePoint Modern mode, circa 2016) we were able to create  custom display templates for search results. This was a great option when your search query was returning a specific Content Type and you could display the various fields in a way that fit the content e.g. showing a red traffic light for expired content.

However when SharePoint Modern appeared on our tenants Microsoft decided not to provide any option to customize the out of the box search, a decision that is hard to understand.

Luckily for Microsoft and us the M365 Community rose to the challenge and the PnP Modern Web Parts project was born.

 

As of today, you can add additional MS Search Vertical on the Site and Tenant level, and we can only hope that one day we will be able to assign an Audience to a Vertical in order to ensure the relevancy for the end user. (hint hint)

 

And NOW (public preview late Dec 22 and complete mid Jan 23) we can create custom item display templates in the shape of Result types with associated Adaptive Cards:

 

 


 

Please note that the Rules is using KQL so all the old queries you have been using for years still works !!!

 


And the skill set required for beautiful looking Adaptive Cards is on my wish list for X-mas but at least I can cheat and learn from the masters at https://github.com/pnp/AdaptiveCards-Templates

 





(Hey it works
😊 )