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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,442)