New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilterDate option in ChangeQuery #833
Labels
Comments
You should be able to do that with change_token_start, but you have to create the token yourself. Maybe something like this: from datetime import datetime
from office365.sharepoint.changes.query import ChangeQuery
from office365.sharepoint.changes.token import ChangeToken
since = datetime(2024, 2, 10, 8, 23, 3)
sp_list = ctx.lists.get_by_title(doc_lib).get().execute_query()
token = ChangeToken("1;3;{0};{1};-1".format(
sp_list.id,
int((since - datetime(1,1,1)).total_seconds() * 10**7),
))
query = ChangeQuery(
item=True, list_=True,
add=True, update=True, delete_object=True,
change_token_start=ChangeToken(token),
)
changes = sp_list.get_changes(query).execute_query() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Referring to #821
@vgrem
Is there a plan to add a FilterDate option in the ChangeQuery or how can the filter query below be combined with ChangeQuery, so we can get the changes beyond a certain date ?
Currently, I use the below- but this does not return the deleted files. Looking for an option to get the created/updated/deleted file beyond a certain date.
Also, for files that are manually deleted from the RecycleBin of sharepoint, will this query be able to report on those files as being deleted ?
The text was updated successfully, but these errors were encountered: