Retrieve modified date for forms in a xml forms library

%3CLINGO-SUB%20id%3D%22lingo-sub-1574115%22%20slang%3D%22en-US%22%3ERetrieve%20modified%20date%20for%20forms%20in%20a%20xml%20forms%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1574115%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%20I%20would%20like%20to%20retrieve%20the%20the%20modified%20date%20of%20the%20forms%20that%20are%20stored%20in%20a%20XML%20forms%20library.%20The%20below%20script%20works%20for%20a%20document%20library.%20How%20do%20I%20revise%20it%20for%20what%20I%20need%3F%20Thank%20you.%3C%2FP%3E%3CP%3E%24SiteURL%3D%20%22%3CA%20href%3D%22https%3A%2F%2Fabc.sharepoint.com%2Fsites%2Ftest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fabc.sharepoint.com%2Fsites%2Ftest%3C%2FA%3E%22%3CBR%20%2F%3E%24ListName%3D%22test%20document%20library%22%3CBR%20%2F%3E%3CBR%20%2F%3E%23Connect%20to%20PnP%20Online%3CBR%20%2F%3EConnect-PnPOnline%20-Url%20%24SiteURL%20-Credentials%20%24userCredentials%3CBR%20%2F%3E%3CBR%20%2F%3E%23Get%20All%20Files%20from%20the%20document%20library%20-%20In%20batches%20of%20500%3CBR%20%2F%3E%24ListItems%20%3D%20Get-PnPListItem%20-List%20%24ListName%20-PageSize%20500%20%7C%20Where%20%7B%24_%5B%22FileLeafRef%22%5D%20-like%20%22*.*%22%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%23Loop%20through%20all%20documents%3CBR%20%2F%3E%24DocumentsData%3D%40()%3CBR%20%2F%3EForEach(%24Item%20in%20%24ListItems)%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%23Collect%20Documents%20Data%3CBR%20%2F%3E%24DocumentsData%20%2B%3D%20New-Object%20PSObject%20-Property%20%40%7B%3CBR%20%2F%3E%3CBR%20%2F%3EFileName%20%3D%20%24Item.FieldValues%5B'FileLeafRef'%5D%3CBR%20%2F%3EFileURL%20%3D%20%24Item.FieldValues%5B'FileRef'%5D%3CBR%20%2F%3EDate%20%3D%20%24Item.FieldValues%5B'Created'%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%24DocumentsData%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1574115%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hello, I would like to retrieve the the modified date of the forms that are stored in a XML forms library. The below script works for a document library. How do I revise it for what I need? Thank you.

$SiteURL= "https://abc.sharepoint.com/sites/test"
$ListName="test document library"

#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials $userCredentials

#Get All Files from the document library - In batches of 500
$ListItems = Get-PnPListItem -List $ListName -PageSize 500 | Where {$_["FileLeafRef"] -like "*.*"}

#Loop through all documents
$DocumentsData=@()
ForEach($Item in $ListItems)
{
#Collect Documents Data
$DocumentsData += New-Object PSObject -Property @{

FileName = $Item.FieldValues['FileLeafRef']
FileURL = $Item.FieldValues['FileRef']
Date = $Item.FieldValues['Created']
}
$DocumentsData
}

0 Replies