I was working on Sitecore SXA 10.3.1 and the workflow was somehow messed up.
Manually modifying can be time-consuming and error-prone. Sitecore SPE is a powerful tool that allows for efficient modification of content in bulk through find and replace text functionality.
In this article, we will explore the steps of using Sitecore SPE to quickly and easily bulk update workflow, streamlining the process, and saving time.
Dry-Run Script:
Running the script won’t make any changes to items, it will give the items that are going to be modified.
I’ve been delving deeper into Sitecore Personalize and have discovered how to incorporate its custom Web Templates into the website.
Let’s dive into the process of creating custom Web Templates and how to utilize them in Web Experiences.
Create Web Template
Let’s navigate to Web Templates in Sitecore Personalize and create it.
The Web Templates have the high flexibility of HTML, CSS, JavaScript, and API tabs to configure.
HTML: Define the structure and content of your web template. This is where you can create the basic layout and elements that will be displayed on your website.
CSS: Style your web template to match your brand’s look and feel. You can add custom styles to ensure that the template is visually appealing and consistent with your website’s design.
JavaScript: Add interactivity and dynamic behavior to your web template. JavaScript allows you to create engaging user experiences by adding features like animations, form validations, and more.
API: Configure API responses to integrate with your organization’s data.
To build the custom web template, let’s say I want to Personalize the About page of my blog.
To create HTML and CSS, we don’t need to dive into the code. A tool called SnipCSS can turn any section of the website into a reusable component.
SnipCSS
SnipCSS is a powerful tool designed to help web developers extract CSS and HTML snippets from any web element or widget. The main key feature is extracting all HTML, images, and CSS with a single click.
Create a separate Authorization in the Identity Server for Forms
Create a Controller to bridge between Custom Submit Action and API call
Set the Custom Submit Action fields
1. Create a separate Authorization in the Identity Server for Forms
Add the FormsServerClient node and its value to the Identity Server’s Sitecore.IdentityServer.DevEx.xml file. After making the change, make sure to IIS Reset for the change to be in effect.
Note: Don’t forget to add transforms for ClientSecret!
Ideally, you can call it in Postman to verify that it’s generating a token using Form’s ClientID and ClientSecret values mentioned in the Sitecore.IdentityServer.DevEx.xml file.
Now that the config is all set to have its own ClientID and ClientSecret, let’s set up the Authorize method with BearerToken specifically for Form’s Identity Credentials.
The SitecoreRestServices handles authenticated HTTP requests to Sitecore’s REST APIs, managing access tokens and retrying requests if authentication fails. It uses dependency injection to configure the HTTP client and obtain the necessary settings.
2. Create a Controller to bridge between Custom Submit Action and API call
Let’s bridge the Custom Submit Action and API call – The CustomController class extends SitecoreController and uses dependency injection to obtain an instance of ICreateAutoPublishService.
It defines a CreateAndPublish method – HTTP POST endpoint that processes CreateAndAutoPublishModel, calls the service to create and publish content, and returns a JSON response indicating success or failure.
The method includes error handling to return appropriate HTTP status codes and messages for different exceptions.
3. Set the Custom Submit Action fields
The final step – Let’s set the Model Type and Error Message based on the class we created.
Publish the form and its related items. It should be good to go!
I recently faced a scenario where I needed to integrate an external website into the Coveo Index and utilize it along with Sitecore Items on the website.
Let’s take my blog as an external data source and integrate it into the Coveo Index.
Trial Account
Feel free to create a new trial account and explore yourself – No credit card is needed it’s free and valid for 14 days.
Note: Please make sure to use your business email.
Sources
After signing up, navigate to the Sources section.
There are many sources available like Sitecore, Web, Sitemap, Sitemap, and many more.
Web Source
Let’s focus on Web sources since we want to add my blog.
There are two Web sources available on-prem crawler and cloud-based crawler. Let’s choose the cloud-based crawler that is with the cloud icon on the right.
When I start filling in my blog URL, it automatically detects the Sitemap for the website – Switching to the Sitemap URL for better Indexing performance.
After switching, it automatically updated to a Sitemap source with the appropriate sitemap URL.
Content Security
The next step in the setup is Content Security.
We can permit for
Same users and groups as in your content system (Grayed out due to trial account)
Everyone – Anonymous can access
Specific users and groups
By default, the everyone option is selected this would be best for public-facing content.
Let’s change it to Specific users and groups for the demo.
Add Source
Once added after a few minutes the source will be available. You can review other settings if further tuning is needed.
Rebuild Source
Hit save and rebuild source that will initiate the rebuilding of the index.
Download logs provide more in-depth information – It’s super helpful when you face any issues.
Content Browser
Once the rebuild is completed, Open the Content Browser from the left navigation under content to see the items in the index.
It took only a couple of minutes to rebuild the entire blog this depends on the content of the site.
Yay! My entire blog is reindexed and ready to be consumed.
Now, in the Sitecore Coveo Search interface, I could include this as an external source and use the items in the index. We could also set up a blog template and display the results with images. The source type can also be used as a facet.
I encountered a situation that the website was internally facing, which needed a form that would not save the data in the Experience Forms database. Also the data needs to be saved as an Item in the master database so it could be published and consumed in a listing page.
At first, I considered creating a Custom Submit Action to create and publish an item. However, I later realized that the CD server lacked access to the CM server, preventing it from directly generating an item in the master database. So, I came up with the idea of creating a custom API service and combining it with a custom submit action.
Solution
To implement this followed this process
Create Custom Submit Action in Sitecore
Create a code-behind class that inherits SubmitActionBase
Create a secure API that can create and publish an item
Create an API authorization user in the identity server
Create a Controller to proxy between Custom Submit Action and API calls
Set the Custom Submit Action fields
1. Custom Submit Action in Sitecore
Create the custom submit action in the following path /sitecore/system/Settings/Forms/Submit Actions.
2. Create a code-behind class that inherits SubmitActionBase
Create a class that inherits the SubmitActionBase class and overrides the Execute method which calls the API asynchronously to create and publish an item.
The CreateAndAutoPublish class extends SubmitActionBase<string> and is designed to handle form submissions in Sitecore, creating and auto-publishing content items.
It uses dependency injection to obtain instances of IHttpClientFactory, BaseSettings, and ISitecoreRestServices, which are lazily initialized. The ExecuteAction method validates the form submission context and parameters, then calls the Execute method to prepare a model from form fields, serialize it to JSON, and send it to a Sitecore API endpoint using an HTTP POST request.
The class includes helper methods to extract values from form fields and handles errors by logging them and adding them to the form submission context’s error collection.
3. Create an API call that creates and publishes the item
The API call does the following things –
Creates an item under a specified folder
Move and Sync the item into a bucket
Publish the item
Clear the Sitecore cache
Ensure the published item is indexed or force index the item
Clear the Vercel Cache for frontend
In Part 2, we will see how to
Create an API authorization user in the identity server
Create a Controller to proxy between Custom Submit Action and API calls
I had to troubleshoot an issue and started with logs. Since we are in Azure PaaS, I used Kudu or App Service Explorer to search for recent logs. It was absolutely time-consuming.
AzureTools comes to the rescue. It is a simple .aspx page that can be dropped into CM environments, and download logs in seconds.
To pull logs from App Insights, need the Application ID and API Key.
Application ID:
Navigate to the Azure App Insights Resource -> Configure -> API Access.
API Key:
– Create the API Key with Read Telemetry access.
Remember to save the key in notes, you can’t get it after creation!
Now I was excited to download logs –
But then it’s erroring out –
The console is showing the following error –
azuretools.aspx:2082 Refused to connect to ‘https://api.applicationinsights.io/v1/apps/e…ityLevel%2C%20customDimensions.ThreadName%2C%20customDimensions.StackTrace’ because it violates the following Content Security Policy directive: “default-src ‘self’ mailto: tel: ‘unsafe-inline’ ‘unsafe-eval'”. Note that ‘connect-src’ was not explicitly set, so ‘default-src’ is used as a fallback.
It made me curious to check the Web.Config – I couldn’t find the content-src node, added the following line.
I wanted to set up a daily Sitecore content synchronization to lower environments to ensure they are updated with the latest content from Production every morning.
The Sitecore Sidekick PowerShell module came to the rescue – Thank you Jeff Darchuk for the excellent module! One of its key advantages is that it eliminates the need to pass usernames or passwords for higher environments.
P.S. I hope you have the Sidekick module installed, it needs a SharedSecret to communicate to the higher environments.
Content Sync:
After successfully installing the Sidekick PowerShell module, I created the following script to sync the Home page and its children from the Production environment to the QA environment.
Similarly, I created the following script for the Data folder on the SXA site, excluding the Sitewide Configuration item.
Scheduling:
With the scripts ready, I have scheduled both using Powershell Scripts Command to run every 12 hours to fetch items.
While working on a Sitecore 10.2.1 XM project, we relied on packaging content from upper environments or restoring the database to pull content locally, which was quite time-consuming.
The Sitecore Sidekick module (a big thanks to Jeff Darchuk) was a lifesaver for quickly pulling content into local or lower environments.
The latest Sidekick version is 1.7 and I was wondering which version will be compatible with Sitecore 10.2.1 and realized it doesn’t matter!
Installation
In NuGet, install the following modules in one of the Foundation projects or create a new helix module.
SitecoreSidekickFoundation
SitecoreSidekickContentMigrator
SitecoreSidekickCore
SitecoreSidekickAuditLog
SitecoreSidekickEditingContext
Note: You can skip AuditLog and EditingContext if don’t want it.
After installation, you will see the following DLLs in the bin folder
Configuration
Create a folder Sidekick under App_Config/Include in the Foundation layer.
Add the following Config files as it is, no changes are needed.
We have some secure PDFs in Media Library that were not getting indexed in Solr – They couldn’t be extracted using the PDFSharp library.
The logs were showing the error while extracting secure files
16804 12:04:53 ERROR DefaultMediaItemTextExtractor: Cannot extract content from media item with id ‘{442006A5-8CB6-4ABE-8855-786D2A870201}’. Exception: PdfSharp.Pdf.IO.PdfReaderException Message: The PDF document is protected with an encryption not supported by PDFsharp. Source: PdfSharp at PdfSharp.Pdf.Security.PdfStandardSecurityHandler.ValidatePassword(String inputPassword) at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) at PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) at Sitecore.ContentSearch.ContentExtraction.Readers.PdfSharpReader.ReadAll(String filePath) at Sitecore.ContentSearch.ContentExtraction.Common.DefaultMediaItemTextExtractor.ExtractTextFromMedia(MediaItem mediaItem)
38536 12:04:53 ERROR DefaultMediaItemTextExtractor: Cannot extract content from media item with id ‘{442006A5-8CB6-4ABE-8855-786D2A870201}’. Exception: PdfSharp.Pdf.IO.PdfReaderException Message: The PDF document is protected with an encryption not supported by PDFsharp. Source: PdfSharp at PdfSharp.Pdf.Security.PdfStandardSecurityHandler.ValidatePassword(String inputPassword) at PdfSharp.Pdf.IO.PdfReader.Open(Stream stream, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider passwordProvider) at PdfSharp.Pdf.IO.PdfReader.Open(String path, String password, PdfDocumentOpenMode openmode, PdfPasswordProvider provider) at Sitecore.ContentSearch.ContentExtraction.Readers.PdfSharpReader.ReadAll(String filePath) at Sitecore.ContentSearch.ContentExtraction.Common.DefaultMediaItemTextExtractor.ExtractTextFromMedia(MediaItem mediaItem)
After the installation is completed open the following URL http://localhost:9998 to see if it is working as expected. You should see the welcome message!
Add the following patch file into App_Config/Include/zzz folder to replace DefaultMediaFileTextExtractor from Sitecore.ContentSearch.ContentExtration.
Last step – Let’s add Tika URL into ConnectionStrings.config file.
The Sitecore Command Line Interface (CLI) is a developer tool that provides a command-line interface to interact with Sitecore instances for serializing templates, layouts, and renderings.
Let’s explore the installation and Configuration on Sitecore 10.x.
To initialize a new project, run the below command.
dotnet sitecore init
Note: Starting from 4.1.0, the sitecore init command takes care of installing default plugins (Sitecore.DevEx.Extensibility.Serialization, Sitecore.DevEx.Extensibility.Publishing, Sitecore.DevEx.Extensibility.Indexing, and Sitecore.DevEx.Extensibility.ResourcePackage).
Skip the below step if you are installing Sitecore CLI 4.1.0 or above.
I installed Coveo 5.0.1039.1 on the Sitecore 10.1 instance locally.
After Coveo activation, the indexes weren’t loading and threw an error.
The logs showed ‘The parameter ‘p_ApiKey’ must not be an empty string’ error.
Exception: System.ArgumentException
Message: Precondition failed: The parameter 'p_ApiKey' must not be an empty string
Parameter name: p_ApiKey
Source: Coveo.Framework
at Coveo.Framework.CNL.Precondition.RaiseArgumentException(String p_Message, String p_ParameterName)
at Coveo.Framework.CNL.Precondition.NotEmpty(String p_Parameter, String p_ParameterName)
at Coveo.CloudPlatformClientBase.Communication.CloudPlatformHttpClientFactory.CreateAuthorizedJsonHttpClient(String p_ApiKey)
at Coveo.CloudPlatformClientBase.CloudPlatformClient..ctor(CloudPlatformConfiguration p_Configuration, ICloudPlatformHttpClientFactory p_CloudPlatformHttpClientFactory, IPipelineRunnerHandler p_PipelineRunnerHandler, ISerializer p_Serializer, ICoveoSettings p_CoveoSettings, IStaticTTLCacheFactory`2 p_StaticTTLCacheFactory, ICriticalExceptionHandler p_CriticalExceptionHandler)
at Coveo.CloudPlatformClientBase.CloudPlatformClient..ctor(CloudPlatformConfiguration p_Configuration)
at Coveo.CloudPlatformClientBase.Communication.CloudPlatformClientFactory.GetCloudPlatformClient(CloudPlatformConfiguration p_Configuration)
at Coveo.SearchProvider.Licensing.CloudLicenseRetriever.GetCloudLicense()
at Coveo.SearchProvider.Licensing.CloudLicenseRetriever.GetLicense(Boolean p_ForceRetrieve)
at Coveo.SearchProvider.Licensing.Cloud.LicenseRetriever.GetLicense(Boolean p_ForceRetrieve)
at Coveo.SearchProvider.Licensing.LicenseManager.RetrieveLicense(Boolean p_ForceUpdate)
at Coveo.SearchProvider.Licensing.LicenseManager.EnsureValidLicense()
at Coveo.SearchProvider.Licensing.LicenseManager.GetLicenseInformation()
at Coveo.SearchProvider.Rest.SitecoreRestHttpHandler.InitializeLicenseSettings()
at Coveo.SearchProvider.Rest.SitecoreRestHttpHandler.OnInitializeSettings()
at Coveo.Search.Api.Proxy.ProxyHttpHandler.OnInitialize()
at Coveo.Search.Api.Proxy.ProxyHttpHandler.EnsureInitialized()
at Coveo.Search.Api.Proxy.ProxyHttpHandler.ProcessRequest(IHttpContext p_Context)
at Coveo.SearchProvider.Rest.SitecoreRestHttpHandlerDispatcher.ProcessRequest(HttpContext p_Context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
After researching, came to know there are two API Keys in Coveo.CloudPlatformClient.Custom.config needs to match with Coveo Platform.
1. apiKey 2. searchApiKey
When I logged into the platform, the keys were not visible since it was secure (not sure where I saved it!), decided to create new keys.
1. SearchApiKey
To create the Search API Key, we must ensure the correct permissions are in place.
Ensure that Impersonate -> Allowed is selected to limit the scope of the API Key, which can be selected from the drop-down list.
2. ApiKey
To create the ApiKey, we need to set multiple privileges.
Content Tab:
Fields -> Edit
Security Identities -> Edit
Security Identity Providers -> Edit
Sources -> Edit all
Organization Tab:
Organization -> Edit
Search Tab:
Search Page -> View all
When the keys are created, make sure to save them in a secure place!
It is time to update the new config keys.
Modify the apiKey and secureApiKey values in Coveo.CloudPlatformClient.Custom.config under AppConfig/Include/Coveo folder
Let’s reload Coveo Index Manager and no more errors.
Download the Configuration files for upgrade <Sitecore 10.3.0 rev. 008463 (upgrade files).zip>
Extract the Sitecore 10.3.0 rev. 008463 (upgrade files).zip file
Scripts Mapping
Now we bunch of files in the extracted folder. We don’t need to run all scripts, Sitecore has given a chart for each Sitecore version upgrade with a list of scripts to run. I’m upgrading from Sitecore 9.3, below is the list of scripts I need to run against clone databases.
Script A – CMS_core_master_web8x.sql
Script B – CMS_core_master_web9x.sql
Script C – CMS_core.sql
Script D – CMS_master.sql
Script E – CMS_web.sql
Script F – SXP_experienceforms_storage.sql
Script H – CMS_security.sql
Core DB:
Run the Scripts C (CMS_Core.sql) for [Your_Project]_Core_Clone DB
<<CMS_core.sql>>
Run the Script H(CMS_Security.sql) against [Your_Project]_Core_Clone DB since I have a separate Security DB connection string.
<<CMS_security.sql>>
Master DB
Run the Scripts D (CMS_Master.sql) for [Your_Project]_Master_Clone DB
<<CMS_master.sql>>
Web DB
Run the Scripts E (CMS_Web.sql) for [Your_Project]_Web_Clone DB
<<CMS_web.sql>>
Experience Forms DB
Run the Script F (SXP_experienceforms_storage.sql) for [Your_Project]_ExperienceForms_Clone DB
<< SXP_experienceforms_storage.sql s>>
Now we ran all the upgrade scripts, let’s update the connection string of vanilla Sitecore 10.3 XM to Cloned databases.
Update the ConnectionString of Sitecore 10.3 XM Instance:
<<ConnectionStrings.config>>
Let’s point to the Clone Databases by updating Initial Catalog and Password.
Use this tool only if you are upgrading to 10.1.0 or later
The default items have been moved into resource files, the tool will remove them from your databases. (if they have not been modified) from the Core, Master, and Web databases.
If you have modified any of the default items, they are not removed and the tool adds a list of these items to its log file.
Sitecore recommends that you review this list and decide if you still need the modifications, and re-apply your customizations to the new items after you have deleted the old ones.
If you decide that you don’t need the modifications, delete these items from SQL databases.
That default content would come from the actual items resource file which will be placed in App_Data\Items.
If your solution contains any modules or connectors, you should use this tool to upgrade them.
Database Clean-up:
It is a one-time operation, run before running the Sitecore UpdateApp tool
To clean up the content databases:
On the Sitecore Launchpad, open the Control Panel, click Clean up databases, select all the databases, and then click Clean.
It will take some time. Once it succeeds, let’s move to the next step.
I navigated to Sitecore.UpdateApp 1.3.1 page since I’m upgrading it to Sitecore 10.3. The following chart shows which version of the tool you should utilize.
Inside the tool page, you must download the package for the version of Sitecore that you are upgrading from. This file contains the clean-up tool.
Since I’m upgrading from 9.3, I choose Sitecore 9.3 XP.
Download the Sitecore.UpdateApp 1.3.1 for Sitecore 9.3.0 rev. 003498 (XP).zip
Extracted the content to C:\Sitecore_103_Upgrade\Sitecore.UpdateApp
Copy the license file to the Data folder of the tool
2023 has been a great year – I went to India in the Summer and Minneapolis in the Fall to attend three events – MVP Summit, Sitecore DX, and SUGCON- NA (had a lot of learning in organizing!).
Now that Coveo is installed and ready to use, Let us add a Sitecore website to our instance of Coveo.
In the Coveo Admin Console, we can see that there is already a Coveo Master, and Web indexes are added by using the Sitecore Package Installation.
In this blog, I am showing an approach without any installation or configuration on the Sitecore Instance. This approach can be used with any non-Sitecore websites as well.
Let’s add the Sitecore website as a web source of content.
We have lots of options to choose from let us focus on web for now.
Here I’m adding my blog as a Source for our demo.
As soon as adding website name, it recognizes and shows the Sitemap URL and recommends adding it for better performance.
After adding the Sitemap URL, Coveo has a few configurations like Authentication and Content security.
Since the blog is public-facing no security configuration would be needed.
Now add and build the source to populate the index. It might take time depending on the number of pages on the site.
When it’s completed it will turn green and show the number of items in the index and the size.
Now that the Index is built, let’s navigate to Content Browser to see if our pages show up.
Navigate to the content browser and search for a term.
Voila! It works! Now you could integrate Coveo search on your site with a preferred approach.
The latest version Sitecore 10.3, is packed with new features and enhancements that make it easier than ever to manage your digital content and deliver personalized experiences to your customers.
If you’re looking to install Sitecore 10.3 XM, one of the easiest ways to do it is by using the Sitecore Install Assistant (SIA). In this blog post, let’s walk through the steps to install Sitecore 10.3
Prerequisites:
A Windows machine with a minimum of 16GB of RAM
Microsoft SQL Server 2017 or later
IIS 10 or later
.NET Framework 4.8 or later
Microsoft PowerShell 5.1 or later
Preparation:
Download the installation package (Graphical setup package XM scaled) from here.
Installation:
Extract the downloaded zip file
Right-click on the Setup.exe and execute in Administrator mode
Install the prerequisites
Install Solr 8.11.2 by entering the Port, Windows service path prefix, and Install path
Fill out the Siteprefix, admin password(going with b, so easy to remember), and choose the Sitecore license file
Fill out the SQL server Instancename, admin username, and password.
It auto-fills Solr URL, System root, and Windows service name
Note:Navigate to Solr URL and ensure it’s running as expected
Select the optional module if you plan to create a Headless SXA site
Review the summary to make sure the settings are correct
The Installation wizard in SIA validates all the settings before starting the install
Installation takes around 10-15 minutes (you can get a coffee!). If it errors out, check out the log.
Yayy! It’s successfully installed. Is it easy to install with SIA? It’s indeed a great tool!
Let’s log in and explore!
Roadblocks:
Error # 1: Solr access to the path denied
Solr installation failed with error – Access to the path ‘C:\Users\MANBAL~1\AppData\Local\Temp\solr-8.11.2\server’ is denied.
Resolution:
I wasn’t running at the setup.exe in Admin mode. Ran in Admin mode (restarted the machine just in case) fixed the issue.
Error # 2: Unable to create core index
Error CREATEing SolrCore Unable to create core [wc10.3.xm.local_core_index] Caused by: Can’t find resource ‘solrconfig.xml’ in the classpath or ‘C:\Solr\Solr.8.11.2solr-8.11.2\server\solr\sc10.3.xm.local_core_index’
Resolution:
Do not use the same port used for the earlier installation. For some reason, it doesn’t work. Always use the new port and new Solr instance name.
Now that we installed Sitecore 10.3 XM, I’ll be installing Sitecore Headless Rendering (previously known as the JSS module) in my next blog post.
In today’s fast-paced digital world, website content must be constantly updated to stay relevant. Manually modifying content can be time-consuming and error-prone. Sitecore SPE is a powerful tool that allows for efficient modification of content in bulk through find and replace text functionality. In this article, we will explore the steps of using Sitecore SPE to quickly and easily update website content, streamlining the process and saving time.
I encountered a situation where I needed to locate specific text in both images and rich text fields and replace them in large quantities. Essentially, we were transferring media from the Media Library to the Content Hub.
Find Text for Image and RichText Content-Type:
Replace the $contentPath, $guidPattern $mediaPath according to the project.
The $guidPattern is for images containing GUID format like https://cdn.companyurl.com/-/media/897222F0-3BCF-4651-AAC4-6CBBC227B449.ashx that needs to be manually modified since we don’t know where the item path lives in Content Hub. These items I’m adding these to the $cdnItemWithoutGuid array and the list will be given to Content Authors for manual editing.
The results will yield one or two variations of results, dependent on the content, referred to as
Items that contain cdn.companyurl.com with GUID
Items that contain cdn.companyurl.com without GUID
Retrieve the results in CSV, Excel, XML, HTML, and JSON (and also via Email) and analyze them to ensure they are the expected items.
Replace Text for Image and RichText Content-Type:
Replace the $contentPath, $guidPattern, $cdnMediaPath, and $damMediaPath according to the project.
The results will yield one or two variations of results, dependent on the content, referred to as
Changed Items View
Not changed Items View
Upon completion, review the output. Inspect the Not changed Items View to determine the reason for its unchanged status, it could be due to it being in a workflow stage or any other cause.
Coveo’s Diagnostics page is super helpful when troubleshooting any Coveo issues. It is listed in the Coveo Search menu in the Sitecore control panel or can be reached directly with the following url –
This section shows the status of all services related to Coveo. Here is the healthy state, but when it errors it shows the detailed error message
Healthy Component State
Errors in Component State
Coveo for Sitecore version information
It comes in handy for checking Coveo and Sitecore versions and their compatibility.
Current Coveo for Sitecore version: 5.0.1153.1
Current Sitecore version: 10.2.0.6766
Compatibility status: these versions are compatible
Coveo for Sitecore organization information
This section is about the Organization and it is usage details.
Coveo for Sitecore configuration files
Basically shows all Coveo-related config files that are currently loaded in the system.
Coveo for Sitecore published items
It shows if the Coveo-related Sitecore items are published or not, it’s time to publish them 🙂
Coveo for Sitecore Indexing test
This section comes into handy when indexing an item or a path, really helpful when an Item has been published but it’s not available in the Coveo index.
Coveo for Sitecore log viewer
This section is my favorite – I typically use it on Production environments to view the logs when we don’t have access to the server or without logging into the Production servers. We can quickly view the log and troubleshoot the issues.
Indexes List
It shows all the indexes and the IsCoveo flag differentiates the Coveo and Sitecore Indexes.
Download Diagnostics Package
Another super helpful tool – The download Diagnostics Package button at the top of the page.
It creates all necessary config and logs files needed to log a Coveo Support ticket.
When we move into composable architecture. We will need to move the media assets to other platforms. Let’s explore methods of exporting Sitecore Media Library assets to Digital Assets Management (DAM) like Content Hub, AEM, etc. It’s a two-step process of exporting from the source and importing to the destination. We will export the entire Media Library to a zip file and also the asset details to a spreadsheet for validation.
Sitecore Media Library Export to file:
I was exploring the Sitecore Modules, but I realized It could be quickly done using PowerShell Extensions. Right-click on the Media Library node, Navigate to Scripts, and click Download.
The PowerShell script will run for a few mins in my case it ran for 20 minutes for 3GB (depending upon the Media Library size). If you run into timeout issues. Execute at folder levels and finally combine them.
Once the execution is completed it will prompt a pop-up to download the zip file.
P.S: The zip file is temporarily stored in the App_Data folder, but once we download it, it gets deleted.
Sitecore Media Library Export to CSV:
PowerShell extensions script to help export the media library assets file names and path to a spreadsheet.
Another approach to export the data is to use the content export tool.
The following ports needs to be available for containers
The following ports need to be available for running the Docker instance. Make sure you are using stopping the services so it’s available for Docker to consume.
Note: Always use iisreset /stop in the command line rather than stopping it in IIS.
To check the port availability, run the following in PowerShell. It shouldn’t return any process.
netstat -ano | findStr 127.0.0.1:443
netstat -ano | findStr 8079
netstat -ano | findStr 8984
netstat -ano | findStr 14330
Installation:
Extract the file zip file downloaded into Sitecore_10.2(or any folder name).
2. Execute this command to set the execution policy unrestricted.
3. Navigate to XP1 folder (Sitecore_10.2\SitecoreContainerDeployment.10.2.0.006766.683\compose\ltsc2019\xp1) in PowerShell and run compose-init.ps1 script.
.\compose-init.ps1 -LicenseXmlPath <License Path>
Note: I’m installing XP1, If you want XP0, navigate to XP0 folder and follow the same exact steps.
4. Run docker-compose pull
docker-compose pull
5. Run docker-compose up (It takes some time, you can get a coffee!)
docker-compose up –d
Once it’s done, let’s bring in CM instance –
https://xp1cm.localhost/sitecore
Login as adminusing ‘Password12345‘ password (not b though)
It’s so cool see the new desktop view! Cool work Sitecore!
It’s time for CD instance –
https://xp1cd.localhost/
Errors and Resolutions:
If you get unhealthyfor any nodes, don’t worry. It’s very common, I get this most times.
Incognito/private mode to see if Forms are showing up
Rebuilt Forms folder from Developer menu (faster way)
Rebuilt Sitecore Master Index
After doing above all, Forms weren’t still showing up 🙁 Decided to take a deeper dive.
I checked the JobsViewer(/sitecore/admin/jobs.aspx) to check what jobs are running and to my surprise, the re-indexing only Forms folder was running for more than 2 hours and they were so many jobs queued up (Content Authors may be busy creating more content for the website).
I was wondering what’s causing the indexing queue to be clogged. Checked the Crawling log using Sitecore Log Analyzer to see what’s happening and for every single update, it was triggering re-index synchronously and immediately checked the Indexing Strategy for sitecore_master_index and it was set to syncMaster!
This was the root cause of the problem because every time the Content Author was making a change it was triggering the re-index synchronously, whereas it should asynchronously re-indexed with an interval. I switched it to the intervalAsyncMasterstrategy to fix the issue.
Tip: Sitecore Log Analyzer is a powerful tool for parsing Sitecore log files. It provides the interface to explore and navigate through a large amount of log data.
Here is the patch I used to update the index strategy.
Now within few minutes, all queue jobs cleared and moved to finished jobs.
Checked Forms in Designer view, all forms were showing up! Tada!
I was working on a Sitecore 9.0.2 client project and the Sitecore Sidekick(1.4.4 version) was already installed. When I tried to initiate the Sidekick and it was throwing an error –
While researching the error, came to know that I need to update Rainbow and Unicorn (If you use Unicorn in your project to serialize items make sure you install the No Rainbow package as this will not overwrite Unicorn’s Rainbow DLL files but rather utilize whatever version Unicorn is using (Sidekick can work with any version). You can skip if your project doesn’t use it) packages as it wasn’t compatible with the versions that were installed.
I was wondering what version of these packages(SideKick, Rainbow, and Unicorn) will be compatible with Sitecore 9.0.2 and realized it doesn’t matter!
So decided to update the Sidekick(it automatically updates Rainbow) and Unicorn with the latest version via NuGet. Make sure to update all installed Sidekick packages to up-to-date. In my case, I updated the below ones –
SitecoreSidekickFoundation
SitecoreSidekickContentMigrator
SitecoreSidekickCore
SitecoreSidekickAuditLog
SitecoreSidekickEditingContext
It automatically updated all the dependencies like below
Now updating Unicorn(Skip if your project doesn’t use it for serialization)
All packages and it’s dependencies were successfully installed and deployed to QA and UAT environments(it needs to be deployed to the servers in order to make the contract) and the Sidekick started working.
Now we were able to pull content from any environment!
Installing via Sitecore Package
It is not recommended, If you like to install it in environments directly without check-in to source control, you can install it as a package. Download the latest package at the root of the repo.
We were seeing High memory utilization on the xConnect server and it coincides with when our monitoring service reports the site being down. Logs were particularly showing these two errors related to the xConnect –
Error #1:
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
Error #2:
Sitecore.XConnect.Operations.SetFacetOperation`1[Sitecore.XConnect.Facet]: Sitecore.XConnect.Operations.FacetOperationException: Operation #0, AlreadyExists, Contact {32971b60-1245-0000-0000-0611bab4b38e}, Classification
[Error] ["XdbContextLoggingPlugin"] XdbContext Batch Execution Exception
Sitecore.XConnect.Operations.FacetOperationException: Operation #0, AlreadyExists, Contact {32971b60-1245-0000-0000-0611bab4b38e}, Classification
[Error] XConnect Exception Filter OnException(), url - "https://prod9-xconnect.everence.com/odata/Contacts?%24filter=Identifiers%2fany(id:id%2fIdentifier+eq+'a5642a9a87ad41e1ab65a624b7d1b1f6'+and+id%2fSource+eq+'xDB.Tracker')&%24expand=Identifiers,MergeInfo,ConsentInformation,Classification,EngagementMeasures,ContactBehaviorProfile,Personal,KeyBehaviorCache,ListSubscriptions,AutomationPlanEnrollmentCache,AutomationPlanExit,TestCombinations"
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.AuthenticationFilterResult.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()
Investigation:
Created a dump using the Procdumptool. Here is the command I used for creating 18GB of the dump file
procdump -m 18000 -ma [Name or PID]
From reviewing the memory dump, we could see two SQL queries that have consumed 8GB and 6GB of memory in your XConnect instance.
Both queries were running the [xdb_collection].[GetInteractionsByContactIds] stored procedure. This stored procedure retrieves interaction data for a contact.
The queries are attempting to retrieve the interactions for a specific Contact ID. After reviewing some of the retrieved interactions from this contact, we could see the User-Agent for this contact was
Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PingdomTMS/0.8.5 Safari/534.34
The above agent is Pingdom (It is a website monitoring and availability service) to have many interactions stored in XConnect. Although it’s a bot, it was considered a valid user and the interactions were being tracked.
Resolution:
In order to mitigate the interactions from Pingdom, we added the User-Agent of Pingdom to the <excludedUserAgents> configuration (Sitecore.Analytics.ExcludeRobots.config) so that future visits from Pingdom are treated as a bot and not saved to XConnect.
I came across a scenario, where I need to update the email field for all custom forms built with ‘EmailTemplate’. Since it’s going to be a bulk update, decided to do it in SPE(so powerful!)
Here is the script I wrote –
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sitecore 10 was out a couple of months back. I installed it using SIF, hit a couple of roadblocks while installing and sharing the resolutions that helped resolve the issues.
If you haven’t installed Sitecore 10, here are some blogs that help you install.
I have multiple Solr services running for different versions of Sitecore and here is the error I got while installing Sitecore 10.
“Port 8984 is already being used by another process. Please choose a different port”.
Run services.msc to check how many Solr’s are running on the machine.
Resolution:
If you have multiple instances of Solr running and you don’t know what port, it’s associated with. Here is a quick way to get the process name and kill if it’s is no longer needed.
Also when installing the Solr, you can add the Port Name and Sitecore Version number or any information in the Description of Details tab.
This is life saver, do not need to worry about which Solr maps which port in the future!
Error # 2: SQL User Issue
“msdeploy.exe : Error: .Net SqlClient Data Provider: Msg 12809, Level 16, State 1, Line 5 You must remove all users with password before setting the containment property to NONE. At C:\ProgramFiles\WindowsPowerShell\Modules\SitecoreInstallFramework\2.2.0\Public\Tasks\Invoke-CommandTask.ps1:31 char:13”
Resolution:
For some reason, the SC10 uninstall did not remove all the variables for failed instances. I removed the ‘sc10_CollectionUser’ in local DB users, fixed the issue.
Error # 3: Credential Issue
“Install-SitecoreConfiguration: A parameter cannot be found that matches parameter name ‘Credential’. This error might have been caused by applying the default parameter binding. You can disable the default parameter binding in
$PSDefaultParameterValues by setting $PSDefaultParameterValues[“Disabled”] to be $true, and then trying again. The following default parameters were successfully bound for this cmdlet when the error occurred: -Debug -WarningAction
-Verbose -InformationAction -ErrorAction
At C:\ResourceFiles\XP0-SingleDeveloper.ps1:77 char:1
After you install the tools, restart your machine.
SameSite cookies and custom domains:
The commonly-used browsers such as Chrome and Safari are changing how the browsers interpret the SameSite cookie. After the change takes effect, Horizon will only work if the Sitecore Horizon host instance, the Sitecore identity instance, and the Sitecore CM instance belong to the same site.
Download Horizon 10 from here. I downloaded the on-premises deployment.
Extract the zip file and open InstallHorizon.ps1
Fill out the below parameters –
Run the InstallHorizon.ps1 in Adminstrator mode.
Once the installation is done (only takes 2 to 3 minutes), you will see a new Icon in Sitecore XP.
Clicking the Icon opens Horizon (yes, it’s separate IIS site) in a new tab and you can explore the new features!
Post Installation
To use the alignment and indentation features in the rich text editor in Horizon, make sure to add the below styles to your default style sheet (like default.css in your project).
Sitecore 10 is out! I tried installing it using SIA(Sitecore Install Assistant) along with SXA and it installed smoothly without any errors!
Prerequisites:
No need to install any prerequisites(includes Solr, SIF) manually, SIA will take care of it.
Preparation:
Download installation package (Graphical setup package XP Single) from here.
Installation:
Extract the file zip file downloaded and click on Setup.exe
Install the prerequisites to make sure the required SIF and Windows Server prerequisites are up to date.
Install Solr 8.4.0 by filling Port, Windows service path prefix and Install path and Install.
Note:Make sure the port number is different from earlier versions of Solr installed.
Fill out site prefix, admin password (going with b, so easy to remember) and Confirm password (new to Sitecore 10), and license file path.
Fill out SQL server instance name, admin username and password.
Double-check the Solr URL (browse to make sure it’s running successfully), System root and Windows service name
Select optional module SXAif you need. I’m going for it, time to explore SXA! Would be nice if Horizon is listed here.
Review the summary to make sure the settings are correct.
SIA validates to make sure the files look good.
Install. This takes around 10 minutes (you can get a coffee!). If it errors out, check out the log.
Yayy!! It’s installed. Is it easy to install with SIA? It’s indeed a great tool!
Check out the release notes for what’s new in Sitecore 10.
Error:
While installing got this error –
Failed to start service ‘Sitecore Marketing Automation Engine – sc10.xp.dev.localxconnect.dev.local- MarketingAutomationService (sc10.xp.dev.localxconnect.dev.local- MarketingAutomationService)’.
Failed to start service Sitecore Marketing Automation – MarketingAutomationService
Resolution:
This could be due to a license expiry issue. In my case, I had a valid license file. Resolved the issue by moving the non-self signed certificates to trusted certificates.
I ran this command as an admin and got a couple of certificates that were non-self signed.
Ensure Sitecore Identity is installed. For example, if your Sitecore CMS instance has the address https://cmdomain.com, then install Sitecore identity with the address identity.cmdomain.com
Download Horizon 9.3 from here. I downloaded the on-premises deployment.
Extract the zip file and open Parameters.ps1
Fill out the below parameters –
Run install.ps1 in Powershell Administrator mode
Once the installation is done (only takes 2 to 3 minutes), you will see a new Icon in Sitecore
Clicking the Icon opens Horizon (yes, it’s separate IIS site) and you can explore the new features!
Troubleshooting Error
I faced this error after the installation was successful. When I opened Horizon, here is the error message I got.
Failed to render a page: Failed to render the root extension, with error: Failed to render a fragment. Status code: InternalServerError, message:
I checked the logs (C:\inetpub\wwwroot\[Hoirzon Website\logs) and it showed below message
[1] Ensure that Node.js is installed and can be found in one of the PATH directories.Make sure the Node executable is in one of those directories, or update your PATH.
I verified that the Node.js path (C:\Users\manbalagan\AppData\Roaming\nvm\v10.16.0\) was accessible and PATH was correct.
Also, I uninstalled Node v10.16.0 and reinstalled. Restarted my machine. Nothing helped.
Finally, I resolved the issue by adding ‘Everyone‘ permission and allowed full control to NVM folder (C:\Users\manbalagan\AppData\Roaming\nvm) fixed the issue! IIS couldn’t access the folder without ‘Everyone’ permission.
Uninstall
If you want to uninstall the failed versions (to clean up IIS sites it created), here is how you can do it –
Uninstalling is straight forward – just need to run the uninstall.ps1 script
After uninstalling, it didn’t remove the Horizon Icon in Desktop mode. Clicking on the icon goes to 404 page. It would be clean if the icon is also removed.
Hope this helps someone. Any issues, let me know in comments section.
Browser Extensions are handy and easy to use without leaving the tab. Here are the top 5 Sitecore Chrome Extensions I use daily and it saves ton to time!
This extension is a lifesaver and must have! Here is the set of handy tools into Content Editor. Favourites Bar, Desktop notifications, and Dark mode are my favorites.
This tool allows navigating to admin pages like cache, serialization, show config (I use this most of the time), etc. Also, you can switch between databases or set a new database on the options page.
Are you looking for a generic method to read the values from any type of Sitecore Form fields? Here is the solution.
private static Dictionary<Guid, string> FormFieldsToDictionary(IList<IViewModel> fields)
{
Dictionary<Guid, string> fielDictionary = new Dictionary<Guid, string>();
foreach (var field in fields)
{
fielDictionary.Add(Guid.Parse(field.ItemId), field.GetType().GetProperty("Value")?.GetValue(field, null)?.ToString() ?? string.Empty);
}
return fielDictionary;
}
private static string GetValue(IViewModel field)
{
if (field == null)
{ return default(string); }
if ((field as StringInputViewModel) != null)
{
return (string)(object)(field as StringInputViewModel).Value;
}
if (field is ListViewModel)
{
var listField = (ListViewModel)field;
var array = listField?.Value?.ToArray();
if (array == null)
{
return string.Empty;
}
return String.Join(",", array);
}
if (field is DateViewModel)
{
var dateField = (DateViewModel)field;
return dateField.Value.HasValue ? dateField.Value.Value.ToShortDateString() : string.Empty;
}
if (field is NumberViewModel)
{
var numberField = (NumberViewModel)field;
return numberField.Value.HasValue ? numberField.Value.ToString() : string.Empty;
}
if (field is TextViewModel)
{
var textField = (TextViewModel)field;
return (string)(object)textField.Text;
}
if (field is CheckBoxViewModel)
{
var checkbox = (CheckBoxListViewModel)field;
return (string)(object)checkbox.Value;
}
return default(string);
}
Utilization:
protected override bool Execute(UpdateContactData data, FormSubmitContext formSubmitContext)
{
var fieldsDictionary = FormFieldsToDictionary(formSubmitContext.Fields);
// From here you can create a model from fieldsDictionary, call any API and return call status
}
Hope this helps someone. Any questions, leave a comment.
You can now publish the forms within Forms Designer. No need to navigate to Content Editor to publish. This is pretty handy when developing forms.
Users can now delete submitted data for a particular form and specify a date range.
You can now use the Sitecore bot detection functionality to verify whether visitor is human. This removed the need for a Captcha element. Nice work Sitecore!
Now the forms element that allows you to add email confirmation to a form.
Users can now use the Redirect submit action to redirect to a URL and pass parameters to it.
To add file upload functionality to your forms, you can now use the File upload forms element. I use to utilize the Forms Extensions module(It’s very nice), it’s now included in forms element.
Apart from these, there are bunch of enhancements made –
Improved database performance by increasing our ability to prevent deadlocks.
You can now use the client-side API to retrieve form fields, for example when you build a custom submit action that needs to show all the form fields.
You no longer need to rebuild the master index after you install Sitecore XP.
Hope this helps. Any questions, leave a comment below.
I’m participating in Sitecore Hackathon 2020 for the second time. One of the requirement is to have sitecore 9.3 installed on your machine except for commerce . I want to share my experience how i quickly installed Sitecore 9.3 using SIA(Sitecore Install Assistant) in 20 minutes!
Note: No need install any prerequisites(includes Solr) manually, SIA will take care of it.
Preparation:
Download installation package (Graphical setup package XP Single) from here.
Installation:
Extract the file zip file downloaded and click on Setup.exe
Install the prerequisites if needed.
Install Solr 811 by filling Port, Windows service path prefix and Install path and Install.
Note:Make sure the port number is different from earlier versions of Solr installed.
Fill out site prefix, admin password(going with b, so easy to remember) and license file path.
Fill out SQL server instance name, admin username and password.
Fill out the Solr URL, System root and Windows service name
Note:Go to Solr URL to make sure it’s running successfully.
Select optional module SXAif you need. I’m going for it, time to explore SXA! Would be nice if Horizon is listed here.
Review the summary to make sure the settings are correct.
SIA validates to make sure the files look good.
Install. This takes around 10 minutes (you can get a coffee!). If it errors out, check out the log.
Yayy!! It’s installed. Is it easy to install with SIA? It’s indeed a great tool!
Check out the release notes for what’s new in Sitecore 9.3 here
2019 is going great so far, wanted to share my contributions to the Sitecore community(Awesome!).
Presented Sitecore 9 Forms(Intermediate/Advance) in 7 SUG’s-
• April 18 2019 – SUG Bulgaria • May 4 2019 – SUG Bangalore • June 4 2019 – SUG Manchestor, NH • June 6 2019 – SUG Belarus • June 12 2019 – SUG Boston • June 25 2019 – SUG NCR(Delhi -India) • Aug 29 2019 – SUG Educador
The blog posts I have written and one of my blog post received ‘You are life saver, Thank you’ comment.
• Install Sitecore 9.1 quickly in 5 easy steps • Sitecore 9 Forms: Redirecting to formbuilder on Submit? • Sitecore 9 Forms: The required anti-forgery cookie __requestVerificationToken is not present • Sitecore license file expired? • Sitecore 9.1 Forms: Conditional Logic • Sitecore 9 Forms: Custom Control – Conditional Section • Sitecore 9 Forms: Success message • Sitecore 9 Forms: Custom Submit Action • Tips and Tricks : GIT Cherry Pick • Sitecore Certification : Exam and Review • Sitecore 9 Forms: Save Data • Sitecore 9 Forms: Custom Regex Validation • Sitecore 9 Forms: Custom Grouped dropdown • Sitecore 9 Forms: Uncaught TypeError: Cannot read property ‘unobtrusive’ of undefined • XConnect: Certificate was not found • Sitecore 9 Forms: Access landing page fields in FormSubmitContext? • Sitecore 9 Forms: The date range is invalid. Please select a date range that is within the range of the list. • Sitecore Forms: Export Data to CSV shows Field Types on column header? • Sitecore Forms: Redirecting to External URL
Youtube • How to add Forms Custom Submit Actions – https://www.youtube.com/watch?v=wE_aaFN7GvY
I came across a scenario where I need to redirect to a external url(thank you page) after form submission. It’s achievable using formSubmitContext’s RedirectUrl property on your Custom Submit Action.
Here is the code snippet –
protected override bool Execute(string data, FormSubmitContext formSubmitContext)
{
//Prepare model
//WebApi Call
//Redirect to external URL
var thankYouPageUrl = $"{HttpContext.Current.Request.Url?.Scheme}://{HttpContext.Current.Request.Url?.Host}/[thank-you-page-path]/";
formSubmitContext.RedirectUrl = $"{thankYouPageUrl}?id={add-any-querystring-if-needed}";
formSubmitContext.RedirectOnSuccess = true;
return true;
}
I deployed the forms to Staging environment and see how the forms were performing.
I exported the data using Export form data into CSV button and i received ‘The date range is invalid. Please select a date range that is within the range of the list.‘ error.
I tried different range and it threw the same error. I checked the db([project]. ExperienceForms) and there was NO DATA!
I submitted the form and tried again. It downloaded the CSV file with an entry on it.
I came across a scenario where I needed to access landing page fields(the page where we add Forms) in Custom Submit Action’s FormSubmitContext.
By default, the page item isn’t known at the Submit Action. So started thinking should i create a custom hidden field or use the Forms Extensions module? At the end of the day, i didn’t need either.
Here is the quick way to access the current page using HttpContext’s AbsolutePath.
protected override bool Execute(string data, FormSubmitContext formSubmitContext)
{
var contextItem = GetContextItem.GetItem(HttpContext.Current.Request.UrlReferrer?.AbsolutePath) as ILandingPageContentItem;
// Access fields from ContextItem
}
public class GetContextItem
{
public static IStandardTemplateItem GetItem(string path)
{
Item item = Sitecore.Context.Database.GetItem($"/sitecore/content/<tenant>/Home{path}");
return item?.AsStronglyTyped();
}
}
Hope this helps someone. Any questions, please leave a comment.
Experience Analytics was not working in the Production Azure PaaS environment. I checked the logs and it was throwing Certificate was not found error.
Exception: System.InvalidOperationExceptionMessage: The certificate was not found.Source: Sitecore.Xdb.Common.Webat Sitecore.Xdb.Common.Web.CertificateWebRequestHandlerModifier.Process(HttpClientHandler handler)at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.CreateRequestHandler()at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.CreateClient()at System.Lazy`1.CreateValue()at System.Lazy`1.LazyInitValue()at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteAsync>d__37.MoveNext()--- End of stack trace from previous location where exception was thrown ---at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.<ExecuteGetAsync>d__32.MoveNext()--- End of stack trace from previous location where exception was thrown ---at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)at Sitecore.XConnect.Client.WebApi.ConfigurationWebApiClient.<Refresh>d__4.MoveNext()
My first guess was certificate would have expired, but it was valid.
Second guess was thumbprint could be wrong, but thumbprint was perfectly matching with the config value(\App_Config\AppSettings.config file , in the validateCertificateThumbprint setting).
Started wondering why it can’t find the certificate for some reason? Came to know that need to add an application setting to the web app called WEBSITE_LOAD_CERTIFICATES and the value needs to be the certificate thumbprint.
This application setting is required for the app service to load the certificate into the local certificate store of the host running the app service.
Once the setting is added and I no longer see the error in logs and the Experience Analytics started showing some number/graphs. Yay!
Hope this helps. Any questions, please leave a comment.
Are you getting this error on Sitecore 9 Forms Submission? I got it and it took me some time to figure out. It’s all related to Validation. Here are the points to check to narrow down the issue —
If you have form fields set it to mandatory, change it to optional and see if that makes the submission successful. If so, one of the field validation is causing trouble.
It happens for custom form control quite often, where you need add the validation to razor view file and make sure you have this attribute – GenerateUnobtrusiveValidationAttributes.
Compare your custom control razor file to any one of inbuilt form controls ([iis-site-folder]\Views\FormBuilder\FieldTemplates ) like below and if you see any difference on attributes, add it out.
Finally a simple check: make sure to publish all the forms and view the landing page in live mode(not in preview mode)
I came across a requirement from a client that they wanted to show Country and it’s states grouped in a dropownlist. I created a custom grouped dropdown to fit into the scenario. Since this is an extension of dropdownlist, no speak knowledge required.
Let’s get started
Step 1: Create custom dropdown list
Create a custom dropdownlist under /sitecore/system/Settings/Forms/Field Types/Lists based on Field Type(/sitecore/templates/System/Forms/Field Type) template like below
Step 2: Create a code behind class and razor view
create a code behind class like this in VS project
using System.Collections.Generic;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.ExperienceForms.Mvc.Models.Fields;
namespace Sitecore.Project.Example.Views.StateDropdown
{
public class StateDropdown : DropDownListViewModel
{
protected override void InitItemProperties(Item item)
{
Assert.ArgumentNotNull(item, nameof(item));
base.InitItemProperties(item);
}
protected override void UpdateItemFields(Item item)
{
Assert.ArgumentNotNull(item, nameof(item));
base.UpdateItemFields(item);
}
public Dictionary<string, Dictionary<string, string>> Regions()
{
if(string.IsNullOrEmpty(DataSource)) return new Dictionary<string, Dictionary<string, string>>();
Dictionary<string, Dictionary<string, string>> counrtyCollection = new Dictionary<string, Dictionary<string, string>>();
Item item = Context.Database.GetItem(DataSource);
var children = item.GetChildren();
foreach (Item child in children)
{
counrtyCollection.Add(child.Fields["Name"].Value, new Dictionary<string, string>());
foreach (Item desc in child.Children)
{
counrtyCollection[child.Fields["Name"].Value].Add(desc.Fields["Name"].Value, desc.Fields["Code"].Value);
}
}
return counrtyCollection;
}
}
}
Create a razor view like this and build project
@using Sitecore.ExperienceForms.Mvc.Html
@model Sitecore.Project.Example.Views.StateDropdown.StateDropdown
@{
var regions = Model.Regions();
}
<label for="@Html.IdFor(m => Model.Value)" class="@Model.LabelCssClass">@Html.DisplayTextFor(t => Model.Title)</label>
<select id="@Html.IdFor(m => Model.Value)" data-trigger name="@Html.NameFor(m => Model.Value)" class="@Model.CssClass" placeholder="Select Your Work Location" data-sc-tracking="@Model.IsTrackingEnabled" data-sc-field-name="@Model.Name" @Html.GenerateUnobtrusiveValidationAttributes(m => m.Value)>
<option placeholder>Select Your Work Location</option>
@foreach (var region in regions)
{
<optGroup data-id="@region.Value" label="@region.Key">
@foreach (var state in region.Value)
{
<option value="@state.Value">@state.Key</option>
}
</optGroup>
}
</select>
@Html.ValidationMessageFor(m => Model.Value)
Step 3: Fill out the fields
Fill out the View Path, Model Type and Property Editor(should be Property Editor Settings/DropDown List).
you are now all set to utilize the custom dropdown list in Forms Designer. Don’t forget to publish the field!
Hope this is helpful. Any questions, please leave a comment.
I came across a scenario where i implemented a custom validation on Sitecore 9 Forms. Sharing my knowledge here. You can achieve this in three simple steps.
Step 1: Create custom validator
Create a custom validator under /sitecore/system/settings/forms/validation based on Validation(sitecore/templates/System/Forms/Validation) template like below
Step 2: Fill out the fields
Fill out your own regex and error message. You can copy the Type value from other validator.
Step 3: Assign the custom validator
You can now add the new custom validator to any Form fields( /sitecore/system/Settings/Forms/Field Types). All set and no code required!
Hope you found this blog helpful. Any questions, please leave a comment.
I have Sitecore 9.1 instance and today my sitecore license file expired. I had to replace the license.xml in multiple places to make sure my site, xConnect and Identity Server sites work.
Have you submitted a form and it returned with this error ‘The required anti-forgery cookie “__requestVerificationToken” is not present’? If so, here is the resolution.
This could be because of caching. Can you check if your rendering component or container/page level caching check box is checked? if so, unchecking the caching will fix the issue.
Also here is quick check you can do to see whether your form is cached – Inspect the form and check the _requestverificationtoken value like below and refresh the page – do you see same value now? if so, your form is in cache!
I’m participating in Sitecore Hackathon for the first time this year. One of the requirement is to have sitecore 9.1(Initial version) installed on your machine. So I want to share my experience how i quickly installed Sitecore 9.1 using SIF on developer machine in 5 easy steps. This post includes the prerequisites, preparation and installation.
Prerequisites:
OS: Windows 10, Windows Server 2016
DB:
Microsoft SQL Server 2017 or 2016 SP2 – Supports the XM database and is the required for the xDB
Microsoft SQL Server 2014 Sp2 – Only supports XM databases and does not support the xDB
MongoDB Server 3.6.6 – This is required if you are going to use MongoDB for the Collection database or as a Session State Provider
IIS 10
. NET
Sitecore XP 9.1.0 requires .NET Framework 4.7.1
Sitecore Identity server requires .NET Core Runtime 2.1.3
You must apply any available updates to the .NET Framework on every Sitecore installation
Search Indexing
Solr 7.2.1 – Default search provider
Azure Search – supported and recommended for Azure Cloud PaaS deployments only
Lucene – Only supports content search and does not support xConnect.
Powershell 5.1 – for Installing SIF
Preparation:
Download installation package(XP Single) from here
Extract the zip file you just downloaded
Again extract this file – XP0 Configuration files 9.1.0 rev. 001564.zip
Copy your license.xml file (If you have enrolled for Hackathon, you should have received the file in email)
Update the following files in the folder with the exact information – solr path, solr service name, configsets path, instance name for sitecore, SQL instance name and login credentials.
This is a proctor guided exam, no book allowed. Also, the exam software Senitel says you should have an external web camera. It worked with the in-built camera on my work computer. So don’t worry about the external camera.
The exam has 50 questions and 90 minutes to complete. You can review the answers as many times as you want. I completed the exam in 30 minutes and review the answers in the next 30 minutes and I still have 30 more minutes left!
Overall I got a 88% score. Here is my Topic level scoring:
Architecture: 100% Creating and Editing Items: 100% Development Environment: 75% Docs and Support: 100% Installation: 100% Publishing: 100% xManagement: 100% Field Types: 83% Media: 100% Templates: 85% Versioning: 100% Presentation: 77% API: 100% Modules and Packages: 100% Performance: 100% Search: 80%
Once you complete you exam, you will receive an email from test center with score and certification pdf file. Good luck!
Note:
Sitecore Professional Developer – This examination is for Version 8.2
Sitecore Certified Platform Associate Developer – This is for Version 9.0
I came across a situation where I need to merge only couple of commits from branch(not the entire branch) and Git cherry pick does the job pretty clean. I use Git extensions IDE and context menu makes it easier.
Here are the steps:
Make sure you checkout the branch you want to merge the commits
Navigate to the commit you want to cherry pick
Right click and select cherry pick commit option
It opens a dialog with the option to choose auto commit and add commit reference. I recommend checking both of them. By default, they are not checked. Hit Cherry pick button.
Now the commit is auto committed and ready to be pushed into current branch.
Sitecore 9 form feature is awesome and simple to work with. It is more like Visual Studio Toolbox and you can drag and drop the fields.
I had a requirement from Client asking for Ajax form and wanted to show Confirmation/Success message after the form is submitted. Out of the box, this is achievable with the Form.
Here is a small guide on how to create a form with confirmation message:
1. Select Forms from Dashboard.
2. Click Create button.
3. Select blank form.
4. Drag a page for main content.
5. Drag a another page for confirmation message.
6. Design the fields according to needs. Here I’m doing Email Signup form. You can add field validation and css-class as needed.
Please make sure you have these scripts in Layout.cshtml.
I was trying to figure out what would be the best way to list out partial views based on Model type and found C# 7.0 new feature ‘Pattern matching in switch statements’ would be great fit for the scenario.
Before only string/integer can be compared, now you can compare on any type of object. Below is the example shows switch case based on Model Interface type.
@model Synthesis.IStandardTemplateItem
@switch (Model)
{
case INavigationColumnItem nci:
//Take any action
break;
case IColumnNavigationFolderItem ncfi:
//Take any action
break;
case IHeaderLogoItem hli:
//Take any action
break;
case IHeaderNavigationLinkItem hnli:
//Take any action
break;
case IHeaderPhoneNumberItem hpni:
//Take any action
break;
}
Checkout more cool new C# 7.0 features here. Happy coding.