How to update the target field with a constant value?

Use case:

We have to set the owner for the inserted or updated records to the specific constant user in the Target org, instead of the running user that performs the data migration.

How to solve?

In order to solve this, we need to update the Ownerid field for the all object records to the same UserId value.

This can be done using the Value Mapping feature

This configuration should work to update the target OwnerId with constant value.

ObjectName FieldName RawValue Value
[YourObjectApiName] OwnerId /(.+)/ [YouTargetExactOwnerId]

The objective is to setup js regex expression, that will match all source owner ids and will put the target owner id value instead.

You can also play with particular owner source ids to map them to specific target ids.


Note! Remember to update the mapping scheme when you will transfer the data to another target org since the target ids are hardcoded.

Last updated on Tu May 2022