Microsoft Purview

App · 2 actions

Find the email and Teams chats a public records request asks for, and export them to SharePoint once IT approves.

Export to SharePoint

Export what a Find staff email and chats step found, and put it in a SharePoint folder for the clerk: one Outlook data file (.pst) per person, Teams chats as readable transcripts, and a list of every item. Put it after IT's approval. An export can take hours: the run waits without holding anything up, and carries on when the files are ready.

Inputs

SearchsearchtextRequired
The search from a Find staff email and chats step.
SharePoint sitesitetextRequired
The site to save the export in, by its web address, such as https://yourcity.sharepoint.com/sites/Records.
Folderfolder_pathtext
The folder in the site's documents to save into, such as Records requests/2026. Each export gets a folder of its own inside it. Leave empty for Records requests, then the request's name.

Outputs

case_nametext
The Purview case's name.
export_nametext
The export's name in Purview.
file_countnumber
How many files were saved.
fileslist
Each file saved.
folder_pathtext
That folder, in the site's documents.
folder_urltext
A link to the folder the files are in.
sizetext
Their size together.
Example output
{
  "case_name": "Records request 2026-104",
  "export_name": "Lodol export, Staff email, 2026-01-01 to 2026-03-31, 3 people (ref 1a2b3c4d)",
  "file_count": 2,
  "files": [
    {
      "name": "Items.1.001.zip",
      "size": "1.2 GB",
      "url": "https://yourcity.sharepoint.com/sites/Records/Items.1.001.zip"
    },
    {
      "name": "Reports.zip",
      "size": "2.4 MB",
      "url": "https://yourcity.sharepoint.com/sites/Records/Reports.zip"
    }
  ],
  "folder_path": "Records requests/Records request 2026-104/Staff email, 2026-01-01 to 2026-03-31, 3 people (ref 1a2b3c4d)",
  "folder_url": "https://yourcity.sharepoint.com/sites/Records/Shared%20Documents/Records%20requests/Records%20request%202026-104",
  "size": "1.2 GB"
}

Find staff email and chats

Search the email and Teams chats of the staff a records request names, for the dates it asks about, and count what matches. Nothing is read or moved yet: the step says how many items, how big, and from how many people, so IT can approve the search before Export to SharePoint runs it. The search is kept in a Microsoft Purview case named after the request.

Inputs

Records requestrequest_nametextRequired
What the request is called, such as Records request 2026-104. The case in Microsoft Purview gets this name, so IT can find it.
StaffpeoplelistRequired
The email address of each person whose email and Teams chats to search.
Fromstart_datedateRequired
The first day to search, as the request gives it.
Toend_datedateRequired
The last day to search, included.
Words to look forkeywordstext
Words or phrases, one per line. Finds messages that contain any of them. Leave empty to find everything in the dates.

Outputs

case_nametext
The Purview case's name.
end_datetext
The last day.
itemsnumber
How many items match.
keywordslist
The words looked for.
partly_readable_itemsnumber
Items Purview couldn't fully read, such as encrypted attachments. The export includes them.
partly_readable_sizetext
Their size.
peoplelist
The people searched.
people_with_matchesnumber
How many of the people have a match.
searchtext
The search, for Export to SharePoint.
sizetext
Their size, such as 1.3 GB.
size_bytesnumber
Their size in bytes.
start_datetext
The first day.
summarytext
One sentence for IT's approval.
Example output
{
  "case_name": "Records request 2026-104",
  "end_date": "2026-03-31",
  "items": 412,
  "keywords": [
    "parking garage"
  ],
  "partly_readable_items": 12,
  "partly_readable_size": "48.2 MB",
  "people": [
    "jsmith@yourcity.gov",
    "alee@yourcity.gov",
    "mgarcia@yourcity.gov"
  ],
  "people_with_matches": 3,
  "search": "b0073e4e-4184-41c6-9eb7-8c8cc3e2288b/c61a5860-d634-4d14-aea7-d82b6f4eb7af",
  "size": "1.3 GB",
  "size_bytes": 1395864371,
  "start_date": "2026-01-01",
  "summary": "412 items (1.3 GB) from 3 of 3 people, sent or received January 1, 2026 to March 31, 2026, containing \"parking garage\". Plus 12 items Purview couldn't fully read, which the export includes."
}

On this page