cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver III
Resolver III

Overwriting Created On & Created By?

I am importing data to an existing entity in CDS using the Get data from Excel button. My data contains information about the initial user who created the record as well as its original create date time. When I import, Created By and Created On are automatically set to myself and now respectively.

I know there is a field called Record Created On but I can't get this to show up when I am mapping from Excel to my entity fields. Do not see anything called Record Created By.

Can anyone recommend a good way to do this? Not sure if I'm missing something or I just need to create my own custom Created By and Created On fields and set the data there.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User II
Super User II

Hi @Cooper01,

Just to supplement on the previous posts and to summarize, the following fields are the ones you can override/act on behalf. 

Field Override/on behalf field Behavior

Created On

(createdon)

Record Created On

(overriddencreatedon)

When overriddencreatedon is set, createdon will be updated to the overridden date and overriddencreatedon will be the actual date. So in the UI you will see the custom Created On.

Created By

(createdby)

Created On (delegate)

(createdonbehalfby)

Created By will always be the actual user, but the act on behalf user will be set in createdonbehalfby

Modified By

(modifiedby)

Modified By (delegate)

(modifiedonbehalfby)

Same as createdonbehalfby

 

Created On can be set in imports, however unfortunately Created and Modified By (from what I know) can only be recorded in Plugins, Custom Workflow Activities and API calls (SDK and WebAPI) , not Dataflows or imports files.

 

Now, to go back to your original questions:

  1. You're right, in "Get Data" from Excel or Dataflows we can't map the "Created On" field field like in classic import function which seems a defect for me. I would submit a Microsoft Support Ticket at: https://admin.powerplatform.microsoft.com/support
    An alternative is to use the classic import wizard. Set directly the Created On field to your custom date and CDS will automatically set the "Record Created On" to the actual date and put your custom date for Created On.  

  2. For the Created By, unless scripting/coding, plugins or tools like Kingwaysoft, there is no way (up to now) to set the overwrite the Created By field.  An alternative would be to create a custom Created By field and set that in your imports.

Hope this clarifies a little!

View solution in original post

5 REPLIES 5
Highlighted
Responsive Resident
Responsive Resident

Hi @Cooper01 ,

 

In the Data tab of your entity, you can change your view to see an existing view that may have the Created On / Created By fields, or you can create a custom view that includes those columns. Then switch to that view, and Export it so that the template will include those columns. Make sure when you are importing the CSV back in, that you map the Created By lookup fields correctly, as it typically uses the composite FullName, so ensure you put in the full name in the CSV exactly as it matches for the user lookup in CDS.

 

Cpiasecki_0-1602525979163.png

 

Highlighted

Thank you for the response. I was able to export the fields to get the internal names. Created by was referencing an email field. When I added new rows to created on and created by, I was able to map created by only. After completing the import there were no errors, however values I uploaded did not "take" and created by was still myself. Created on was now, which I expected as it's not surfacing in the mappings.

Instead I used the Dynamics Import Tool. That did not allow me to modify created by either so I needed to create a custom field. I was able to overwrite created on

Highlighted

You can override the createdon by mapping to the overriddencreatedon field.

You can't directly override the createdby field in the same way. though this can be done programmatically by impersonating another user (which would also set the modifiedby)

Highlighted
Responsive Resident
Responsive Resident

Hi @Cooper01,

Apologies, I was mistaken. The created by is not directly modifiable for auditing reasons. @DavidJennaway is correct in that you would need to use impersonation to set the created by to a user that is different than the connection user.

Here is info on how to do impersonation based on what programmatic method used. 

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/impersonate-another-user

 

3rd party data migration tools like Kingswaysoft also support this, as long as the user being impersonated exists and is licensed in the target CDS instance. 

---

Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

 

 

Highlighted
Super User II
Super User II

Hi @Cooper01,

Just to supplement on the previous posts and to summarize, the following fields are the ones you can override/act on behalf. 

Field Override/on behalf field Behavior

Created On

(createdon)

Record Created On

(overriddencreatedon)

When overriddencreatedon is set, createdon will be updated to the overridden date and overriddencreatedon will be the actual date. So in the UI you will see the custom Created On.

Created By

(createdby)

Created On (delegate)

(createdonbehalfby)

Created By will always be the actual user, but the act on behalf user will be set in createdonbehalfby

Modified By

(modifiedby)

Modified By (delegate)

(modifiedonbehalfby)

Same as createdonbehalfby

 

Created On can be set in imports, however unfortunately Created and Modified By (from what I know) can only be recorded in Plugins, Custom Workflow Activities and API calls (SDK and WebAPI) , not Dataflows or imports files.

 

Now, to go back to your original questions:

  1. You're right, in "Get Data" from Excel or Dataflows we can't map the "Created On" field field like in classic import function which seems a defect for me. I would submit a Microsoft Support Ticket at: https://admin.powerplatform.microsoft.com/support
    An alternative is to use the classic import wizard. Set directly the Created On field to your custom date and CDS will automatically set the "Record Created On" to the actual date and put your custom date for Created On.  

  2. For the Created By, unless scripting/coding, plugins or tools like Kingwaysoft, there is no way (up to now) to set the overwrite the Created By field.  An alternative would be to create a custom Created By field and set that in your imports.

Hope this clarifies a little!

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (13,563)