web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Sales copilot to d365

(5) ShareShare
ReportReport
Posted on by 5,514
Hi all, 
 
We have created contact from sales copilot and it is showing in d365 .but modified by is showing as some service account .. We have another implementation on modified by value which should not trigger a flow if modified by is ne service account(currently from integration the value us autopopulating)..
 
Can we change the modified by value from service account to user who created the contact from sales copilot... 
 
Categories:
I have the same question (0)
  • Verified answer
    ArchitectMadhan Profile Picture
    458 on at

    Yes, you can change the "Modified By" value in Dynamics 365 to reflect the user who created the contact instead of the service account. Here are a few approaches you can consider:

    1. Using a Plugin: You can write a plugin to update the "Modified By" field. This plugin can capture the original user information and set it accordingly. Here's a basic outline of how you might do this:
    public class UpdateModifiedByPlugin : IPlugin
    {
    public void Execute(IServiceProvider serviceProvider)
    {
    IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
    IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
    IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

    if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
    {
    Entity entity = (Entity)context.InputParameters["Target"];
    if (entity.LogicalName == "contact")
    {
    // Retrieve the original user who created the contact
    EntityReference createdBy = entity.GetAttributeValue<EntityReference>("createdby");
    entity["modifiedby"] = createdBy;
    service.Update(entity);
    }
    }
    }
    }
    [ OR ]
     
    2. Using Power Automate (Flow): You can create a flow that triggers when a contact is created or modified. The flow can then update the "Modified By" field to the original creator's user ID. You might need to use the ValidateUpdateListItem endpoint in REST API to update these fields
     
    If you find this solution useful, please like it and accept it as answer.

    -ArchitectMadhan
  • sandeepc Profile Picture
    5,514 on at
    HHi @architectmadhan
     
    Is there a way to update in classic workflow or business rule as we don't use plugin in our project can you send me steps to create power automate flow?
     
     
    Also can you explain why the modified by showing service account by default ?
  • sandeepc Profile Picture
    5,514 on at
    Hi 
    Any more suggestions
  • Verified answer
    Tom_Gioielli Profile Picture
    3,084 Super User 2026 Season 1 on at
    There are not really any ways to change the value of the [Modified By] field with out of box options, aside from essentially making a change with another user account so the system changes it for you.
     
    Is there a reason you need the [Modified By] to show the user who created it? What does the [Created By] or [Owner] field show and can they be used instead?
  • sandeepc Profile Picture
    5,514 on at
    HHi tom 
     
    Created by showing correct  owner who created but modified by showing service account why is that so ?
     
    I want created and modified by both who has created modified by user 
  • Suggested answer
    Tom_Gioielli Profile Picture
    3,084 Super User 2026 Season 1 on at
    Do you have auditing turned on in your organization and for this table? If the [Created By] field is showing the user, and the [Modified By] is someone else, then it sounds like there is some other automation or process that is updating another value on the table after the create action completes. Auditing should help you figure out what that field is, and track down whatever is updating it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 172

#2
ManoVerse Profile Picture

ManoVerse 58 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans