cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SkiDK
Solution Sage
Solution Sage

SharePoint new item with different Created and Modified

Hi everyone,

I have SharePoint list where I use a PowerApps form to create or update items in the list. When I create a new item, a Power Automate flow will be triggered. In that flow is being checked whether the item is new or modified, by doing next:

Capture.PNG

Now I have noticed that when a new item is created, many times it counts as modified, and not as new because Created and Modified have a difference of a few seconds. 

Example when a new item was created, I received next timestamps:

Created: 2020-10-06T20:51:54Z

Modified: 2020-10-06T20:51:59Z

-> Difference: 5 seconds

It should be the same. Someone knows why this is, or how to fix this? Can it have anything to do with the PowerApps form I use in SharePoint?

Help is very much appreciated. Thanks,

Ski

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @Mira_Ghaly 

Thanks for your reply. In this case though, wouldn't I compare the days with each other? That window is a bit too wide. It can happen that someone wants to edit the item right after it was created.

 

I have a temporary solution now, where I convert both dates to Ticks which I substract to get the difference and divide it by 10000000 to get the difference in seconds. If it is lower than 10 seconds, I count it as New, if higher as Update.

(ticks(Created) - ticks(Modified)) / 10000000 < 10

 

But I don't want to mark it as solution yet, because it's rather a workaround than the solution. I really would like to know why this occurs.

View solution in original post

@SkiDK 

This solution you have suggested will work and makes sense.

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

View solution in original post

3 REPLIES 3
Mira_Ghaly
Dual Super User
Dual Super User

@SkiDK 

This comparison will not work you need to compare using the below expression instead

formatdatetime(createdon,'dd/MM/yyyy') is equal to formatdatetime(modifiedon,'dd/MM/yyyy')

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Hi @Mira_Ghaly 

Thanks for your reply. In this case though, wouldn't I compare the days with each other? That window is a bit too wide. It can happen that someone wants to edit the item right after it was created.

 

I have a temporary solution now, where I convert both dates to Ticks which I substract to get the difference and divide it by 10000000 to get the difference in seconds. If it is lower than 10 seconds, I count it as New, if higher as Update.

(ticks(Created) - ticks(Modified)) / 10000000 < 10

 

But I don't want to mark it as solution yet, because it's rather a workaround than the solution. I really would like to know why this occurs.

@SkiDK 

This solution you have suggested will work and makes sense.

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (3,395)