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:
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
Solved! Go to Solution.
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.
This solution you have suggested will work and makes sense.
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')
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.
User | Count |
---|---|
92 | |
45 | |
21 | |
18 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |