Sitecore analytics trigger goal and add visitor tag


In order to achieve personalisation, sometimes triggering goal programmatically is necessary. The analytics API also provides a way to add tag to visitors. This is useful to differentiate between member types.

Then the presentation components can be personalised based on the goal or the visitor tags.

There you go.


Sitecore workflow email get original or submitting user email

Sitecore Workflow User warning:

Today I did thorough testing on Workflow email. If you use the Workflow ContentHistory to get the submitting user like this as found on the web:

It's a partial solution. It only works the first time approval is requested. Once the item is rejected, the last item in the history will be the approver (and not the submitter!). Using Statistics.UpdatedBy is more accurate since it will always be the user who edits the item.

As to get the approver - this is not available as last history item nor the Statistics.UpdatedBy - just use the approver distribution email in the to field.


Sitecore remove previous versions on duplicating or copying item

Hi all,

When duplicating or copying an item in Sitecore, all the versions are copied to the new item as well. Sometimes this is unwanted behaviour, especially when the first version of the item was not part of the workflow. When you publish the item, the latest published state would be published (i.e. the non-workflow version)

A simple trick is to remove the previous versions of the item when duplicating or copying item. This is done by intercepting the uiCopyItems and uiDuplicateItem.
Note that for uiDuplicateItem, the Sitecore.Buckets.config aborts the pipeline before the original duplicate pipeline. To avoid this, we make sure our custom pipeline is triggered first before the bucket config.

Custom config patch:

Then we have a Sitecore extension helper to remove the previous versions:
DuplicateItem class:
CopyItem class:
And that's it. Note that I applied this to Sitecore 7.2 Update 5


SharePoint 2013 User Profile Sync disabled user

Hi All,

Just want to share a nice post that provides a trick with applying exclusion filter for disabled user accounts.

If you add the filter after the first full profile sync, your filter won't work with Incremental sync unless you do Full sync.

There is a trick to make Incremental sync picks up the changes, which is toggling (Enabling and Disabling) the user in AD and then run the Incremental sync.

This should save you time if the number of disabled users is not that many and this won't clear any user-entered changes on existing user profile data.


SharePoint Infopath 2013 Publish as Content Type duplicate site column mistake!

Hi all,

I have been enjoying my SP journey without InfoPath until two weeks ago when I was asked to help my colleague with Infopath form enhancement.

Looking into how it was deployed to SP online, I noticed quickly it was published as a Content Type. So we did some enhancements, and once it's all done it's time to publish!

What I wasn't aware of is that if the Form Template wasn't obtained from the deployed site, the promoted fields information will be set to 'Create new site column' instead of updating existing content type.

After the form is published, it creates duplicate promoted site columns which are a nightmare to clean up! Not to mention that some site columns are read-only and cannot be deleted through UI.

Luckily, I found that we can use SP JS to do the clean up of all duplicate fields. We just have to be careful to only delete the duplicate ones (marked by '_1' appended to existing field name, or '_12' and '_123' depending on whether '_1' and '_12' exist)

Good lesson learnt: 
In the future, if you want to republish any form template as Content Type, make sure you check each promoted field in the last publish step :

Site column group: {This content type}
Column name: pick the relevant column from the dropdown.