cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

Hi @Anonymous ,

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
eka24
Super User III
Super User III

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.
MatthewInwards
Resolver II
Resolver II

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 🙂

v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

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.
Anonymous
Not applicable

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. 

Hi @Anonymous ,

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (53,486)