# Modifying Examine field value on save

**URL:** <https://forum.umbraco.com/t/modifying-examine-field-value-on-save/6820>\
**Category:** Questions\
**Tags:** v13\
**Created:** [November 28, 2025, 12:36pm UTC](https://forum.umbraco.com/t/modifying-examine-field-value-on-save/6820 "2025-11-28T12:36:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dammark](https://forum.umbraco.com/user_avatar/forum.umbraco.com/dammark/32/347_2.png) [@dammark](https://forum.umbraco.com/u/dammark)\
**Post date:** [November 28, 2025, 12:36pm UTC](https://forum.umbraco.com/t/modifying-examine-field-value-on-save/6820/1 "2025-11-28T12:36:08Z")

</div>

I have some Taxonomy that I want to modify when a document is being saved/published.  
In backoffice it looks like this.

 ![Screenshot 2025-11-28 at 13.15.07](https://forum.umbraco.com/uploads/default/original/2X/8/8dc4376648ac230fe9b7e94d36050b468da8233e.png)

This is how it looks in the index right now for the “tags” field:  
[“Udgivelser”,“Sanglege”,“Rytme/puls/bodypercussion”,“Opvarmning/Stemmetræning/Energizere”,“Rekvisitsange/instrumenter”,“Noder”]

And I would like to look like this:  
[“Udgivelser”,“Sanglege”,“Rytme”,“puls”,“bodypercussion”,“Opvarmning”,“Stemmetræning”,“Energizere”,“Rekvisitsange”,“instrumenter”,“Noder”]

I know how to use notifications to hook into the saving/publishing so that not the issue and I also have made the split of the original data.

I basically just need to figure out how to update the field in the index.  
Can anyone give me a few pointers ?

This is how my code looks for now:

```csharp
public void Handle(ContentPublishingNotification notification)
		{
			if (!_examineManager.TryGetIndex(Constants.UmbracoIndexes.ExternalIndexName, out IIndex index))
			{
				throw new InvalidOperationException($"No index found by name{Constants.UmbracoIndexes.ExternalIndexName}");
			}

			if (notification.PublishedEntities.Any())
			{
				foreach (var item in notification.PublishedEntities)
				{
					var node = _umbracoHelper.Content(item.Id);
					if (node != null && node.ContentType.CompositionAliases.Contains("taxonomiPageComposition"))
					{
						var tags = node.Value<List<string>>("tags") ?? new List<string>();
						var splitTags = tags.SelectMany(tag => tag.Split('/', StringSplitOptions.RemoveEmptyEntries)).ToList();

						// How do I find the document in the index and update the field named tags ?

					}
				}
			}
			
		}

```

---

<div class="post-metadata">

**Author:** ![Nik](https://forum.umbraco.com/user_avatar/forum.umbraco.com/nik/32/118_2.png) [@Nik](https://forum.umbraco.com/u/Nik)\
**Post date:** [November 28, 2025, 2:39pm UTC](https://forum.umbraco.com/t/modifying-examine-field-value-on-save/6820/2 "2025-11-28T14:39:36Z")

</div>

Hi Sebastian,

With what you are trying to do the saving/published events are not the right place to intercept the behaviour. After the Saving/Saved/Publish events run the will trigger Examine to update but Examine has it’s own events that you can hook into.

Typically you would do this using an Umbraco Notification handler that might look something like this:

```cs
public class TransformingExamineValuesHandler : INotificationHandler<UmbracoApplicatoinStartingNotification>

```

In the `Handle` method implementation you would get the relevant index (typically the internal one), convert it to the BaseIndexProvider and then assign an event handler to the TransformingIndexValues event.

```cs
if (_examineManager.TryGetIndex(Umbraco.Cms.Core.Constants.UmbracoIndexes.ExternalIndexName, out var index))
{
    ((BaseIndexProvider)index).TransformingIndexValues += (_, e) =>
    {

```

In side the event handler you can extract the data, update it and, then re-add it before it gets written to the index.

---

<div class="post-metadata">

**Author:** ![system](https://forum.umbraco.com/uploads/default/original/1X/624adeddd330a3d0268a184db47946ca7e82c676.png) [@system](https://forum.umbraco.com/u/system)\
**Post date:** [December 28, 2025, 2:39pm UTC](https://forum.umbraco.com/t/modifying-examine-field-value-on-save/6820/3 "2025-12-28T14:39:39Z")

</div>

Closed on December 28, 2025, 2:39pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
