Forum Discussion
Need to get Site Activity web part data
anjani_chwe are in a GCC High tenant, Site Activity is not available. Please post anything you find on this. I will do the same. Thanks
- Anjani ChallamcherlaMay 16, 2019Copper Contributor
Site Activity web part displays the Recent documents modified by users in current site.
You can get the Recent documents using search query.
But before using the search query you must have the SiteId and WebId of site.
Below is my search query which displays the Recent documents modified by users in current site.
await sp.search({
QueryTemplate: `((SiteID:${assocSites[j].SiteId} OR SiteID: {${assocSites[j].SiteId}}) AND (WebId: ${assocSites[j].WebId} OR WebId: {${assocSites[j].WebId}})) AND LastModifiedTime < {Today} `,
RowLimit: 10,
RefinementFilters: ["FileType:NOT(aspx)", "FileType:NOT(html)", "FileType:NOT(one)"],
SelectProperties: [
"ModifiedBy",
"Title",
"Path",
"LastModifiedTime",
"ParentLink",
"FileType",
"ModifiedById",
"EditorOWSUSER"
],
TrimDuplicates: false,
SortList: [
{
"Property": "LastModifiedTime",
"Direction": SortDirection.Descending
}
]}).then(async (re: any) => {
console.log(re.PrimarySearchResults);
});