Replies: 2 comments
-
Using the |
Beta Was this translation helpful? Give feedback.
-
You should be able to create a change token for changes that occurred within the last hour. This change token can be used to fetch changes from the list using ChangeTokenStart property of ChangeQueryOptions. This will look something like the code below (untested): var ticks = DateTime.UtcNow.AddHours(-1).Ticks;
var changeTokenStringValue = $"1;3;{list.Id};{ticks};-1";
var changeToken = new ChangeTokenOptions(changeTokenStringValue);
var lchanges = await list.GetChangesAsync(new ChangeQueryOptions() { Add = true, File = true, ChangeTokenStart = changeToken }); Also, you might want to use For more info, you could check out: https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/query-sharepoint-change-log-with-changequery-and-changetoken |
Beta Was this translation helpful? Give feedback.
-
I am working on a webhook to find files added to a library that exists in many sites and process them.
when using
var changes = await list.GetChangesAsync(new ChangeQueryOptions(true, true));
I get many old changes and the change I was aiming for.
When I use:
var lchanges = await list.GetChangesAsync(new ChangeQueryOptions() { Add = true, File = true});
I get no items at all
How should I query for the Files added in the last hour only?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions