Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

How to copy 'ownerid' column field value in dataverse table using Azure Data Factory data flow pipeline?

Posted on by 5

As owner field is not a lookup field and its data type is GUID facing issues in adding the value to OwnerId field. Please suggest  a way to make it happen. Thank you.

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 on at
    RE: How to copy 'ownerid' column field value in dataverse table using Azure Data Factory data flow pipeline?

    hi

    To set the value of the OwnerId field in Dynamics 365 when the value is not available as a lookup field, you can use the following steps:

    Retrieve the user or team record for the desired owner and retrieve its GUID.

    Set the OwnerId field value to the GUID retrieved in step 1.

    Here's an example of how you can achieve this in C# code:

    // Retrieve the user or team record for the desired owner

    Entity owner = _service.Retrieve("systemuser", new Guid("USER_OR_TEAM_GUID"), new ColumnSet("systemuserid"));

    // Set the OwnerId field value to the retrieved GUID

    Entity myEntity = new Entity("my_entity");

    myEntity.Attributes["ownerid"] = new EntityReference("systemuser", owner.Id);

    _service.Create(myEntity);

    In this example, replace "USER_OR_TEAM_GUID" with the GUID of the desired user or team record. Also, replace "my_entity" with the logical name of your entity.

    Note that if you want to assign the record to a team, you can use the "team" logical name instead of "systemuser" in the EntityReference constructor.

    DAniele

  • Leco Lv Profile Picture
    Leco Lv on at
    RE: How to copy 'ownerid' column field value in dataverse table using Azure Data Factory data flow pipeline?

    Hi partner,

    Does it apply to the following scenarios?

    community.dynamics.com/.../how-to-copy-ownerid-column-in-another-dynamics-environment-table-in-azure-data-factory

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans