cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to identify which user created a new record?

Hi,

So I've found a way to display which user modified existing data along with the date and time modified through Shane Young's video. Now I want to know is it possible for me to identify which user created a new record in a table along with the data and time created to be displayed inside the gallery. I tried many ways yet failed. Any suggestion to work around it? 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: How to identify which user created a new record?

Hi @rgane ,

Sorry I misunderstood that your data source was sharepoint list.

Since in Excel, there are no system fields like in sharepoint list: Created by,Created,Modified by,Modified, you need to update them by yourslf.

1)Created by,Created,Modified by,Modified: please update them when you create the record

2)Modified by,Modified:please update them every time you edit the record.

Here's my solution:

I assume that you use form to create record and edit record

1)when you create record, try this formula:

Patch(VerificationDetails,Defaults(VerificationDetails),Newform_name.Updates,{Created by:User().Email,Created:Now(),Modified by:User().Email,Modified:Now()})

2)when you edit record, try this formula:

Patch(VerificationDetails,the item that you want to edit,Editform_name.Updates,{Modified by:User().Email,Modified:Now()})

Please replace with your fields name, new form name, edit form name, the item that you want to edit.

If you are using the same form to create record and edit record, try this:

If(Formname.DisplayMode=New,
   Patch(VerificationDetails,Defaults(VerificationDetails),Newform_name.Updates,{Created by:User().Email,Created:Now(),Modified by:User().Email,Modified:Now()}),
   Formname.DisplayMode=DisplayMode.Edit,
   Patch(VerificationDetails,the item that you want to edit,Editform_name.Updates,{Modified by:User().Email,Modified:Now()}
        )
   )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Super User
Super User

Re: How to identify which user created a new record?

If follows same procedure as the modifiedBy.
Create a column in your table CreatedBy.
Then on your form you can insert Now().
Whenever you enter new record the date be captured.
Highlighted
Advocate III
Advocate III

Re: How to identify which user created a new record?

If you are using a sharepoint list as a database then it will be the 'Created' column and the 'Created By' Column.

 

In order to pull these through in a gallery you can use the formula ThisItem.Created and ThisItem.'Created By' on labels.

 

Hope this helps 🙂

Highlighted
Community Support
Community Support

Re: How to identify which user created a new record?

Hi @rgane ,

Do you want to know which fields record the value of creator and created time in sharepoint list?

Please notice these system fields in sharepoint list:

(these are system generated field, no need you to create these fields or update these fields)

1)Created by(person type): the person who create the item

2)Created(date and time type): the time that the item was created

3)Modified by(person type):the person who last modified the item

4)Modified(person type):the time that the item is latest modified

3165.PNG

 You could directly display these fields in powerapps.

For example:

insert a gallery, set its data source to your sharepoint list.

You just need to set the label's Text inside the gallery:

ThisItem.Created

Or 

ThisItem.Modified

Please notice that Created by and Modified by field is person type, so you need to use formula like this:

ThisItem.'Created By'.DisplayName

Or 

ThisItem.'Modified By'.DisplayName

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: How to identify which user created a new record?

Hi @v-yutliu-msft 

Sorry, my data source is a excel file from google drive. Does it use the same method as well ? As for "Modified by" , I use the LastSubmit function for OnSuccess of a form and it worked flawlessly, but how do I record/audit who created a new data by their name and time created ? I've also attached the image of an example of how I record the LastSubmit function. I want something like that to record about the newly created data on the same field. 

Highlighted
Community Support
Community Support

Re: How to identify which user created a new record?

Hi @rgane ,

Sorry I misunderstood that your data source was sharepoint list.

Since in Excel, there are no system fields like in sharepoint list: Created by,Created,Modified by,Modified, you need to update them by yourslf.

1)Created by,Created,Modified by,Modified: please update them when you create the record

2)Modified by,Modified:please update them every time you edit the record.

Here's my solution:

I assume that you use form to create record and edit record

1)when you create record, try this formula:

Patch(VerificationDetails,Defaults(VerificationDetails),Newform_name.Updates,{Created by:User().Email,Created:Now(),Modified by:User().Email,Modified:Now()})

2)when you edit record, try this formula:

Patch(VerificationDetails,the item that you want to edit,Editform_name.Updates,{Modified by:User().Email,Modified:Now()})

Please replace with your fields name, new form name, edit form name, the item that you want to edit.

If you are using the same form to create record and edit record, try this:

If(Formname.DisplayMode=New,
   Patch(VerificationDetails,Defaults(VerificationDetails),Newform_name.Updates,{Created by:User().Email,Created:Now(),Modified by:User().Email,Modified:Now()}),
   Formname.DisplayMode=DisplayMode.Edit,
   Patch(VerificationDetails,the item that you want to edit,Editform_name.Updates,{Modified by:User().Email,Modified:Now()}
        )
   )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,674)