[Teams] Find Files
Q100079: [Teams] Find Files
Locates files on a Microsoft Teams account based on folder and search criteria.
Parameter | In/Out | Description | Other Info |
---|---|---|---|
Teams account | In | Account connection information for Teams member account that has permissions to the specified Team Channel. | Connection type: sysLogin |
Url | In | Url of the Teams site to access. | |
Teams name or Channel | In | The name of the Teams Channel to use. | |
Folder | In | Folder on the Teams site to search. | |
Filename pattern | In | The base filename pattern to look for eligible files, which accepts OS based wildcards for filenames such as the ? and * characters. Can also use the vertical bar character | to specify multiple patterns. Examples: *.png Finds only PNG image files. *.jpg|*.jpeg Finds only JPG and JPEG image files. |
|
Include RegEx | In | Optional filter to only look for filenames matching the specified RegEx. Example: ^.+\d\d\d\d(0[1-9]|1[0-2])(0[1-9]|[12][0-9]|3[01]).txt$ Matches any TXT files that end with a date formatted as YYYYMMDD in the filename. (Case is always ignored.) |
|
Exclude RegEx | In | Optional filter to ignore filenames matching the specified RegEx. Examples: .(bat|exe)$ Ignores any file ending with .bat or .exe ^(readme).*.txt$ Ignores any .txt file that starts with 'readme' in the filename (Case is always ignored.) |
|
Include subfolders? | In | Option to look within subfolders for eligible files. | Default: False |
Age threshold type | In | Choices: None , Older , Newer If filtering by files above or below a certain age, select the theshold option Above or Below. (Age is determined by the file's last modified date.) |
Default: None |
Age threshold value | In | If filtering by files above or below a certain age, enter the integer age threshold value here. (Age is determined by the file's last modified date.) |
|
Age threshold units | In | Choices: Minutes , Hours , Days , Weeks , Months If filtering by files above or below a certain age, enter the units (Minutes, Hours, ...) for the age threshold value. (Age is determined by the file's last modified date.) |
Default: Days |
Matched file list | Out | List of pathnames (files) that matched. |
(Italics = required parameters)
Notes
The [Teams] Find Files
module, as well as the related file copy and move modules, utilizes a different API than some of the other Microsoft Teams modules. This is due to the fact that at the time of the creation of these modules, the only completely supported method for file management in Teams, is to use the Sharepoint API
on which it was originally built upon. It is likely this will change in the future with the release of new modules that will eventually replace these, but currently, this is just an inconvienence in that some of the terminology may be confusing or inconsistent. We will work to avoid that here and help you find the right information to configure these modules correctly. This specific module, [Teams] Find Files
, is analogous to the [Files] Find
module. The primary difference being this module is used for selecting files you want to work with in one of the channels on your Microsoft Teams account.
The Login information
parameter is just a general login connection type. This means you can either specify the Teams account you want this to login as and use, by defining a General Login
connection in the global Connections
section of the JobServer Management Application. This is the recommended option, as connections are internally stored in an encrypted (not plaintext) format. It also provides a way to centrally manage the settings if the same account will be used across multiple jobs and steps.
The Url
parameter is the API endpoint the module uses to communicate with the Microsoft Teams services. This is where we run into some differences in terminology as mentioned in the paragraph above. This value needs to be set to the Microsoft Sharepoint endpoint URL
for your Teams site. This is different than the URL you might assume from the Share
or Copy Link
options in the Teams clients. To locate the proper URL, in your Teams client, follow these steps:
- Navigate to the channel in Teams that you want to be able to locate or transfer files with.
- Make certain that the
Files
tab is selected. - In the files toolbar, you will see the
more options
(...) menu, and select it. - You will find an option there titled
Open in SharePoint
. Select this menu option. - This should open a browser window with an alternate view of the files, but from within the Office365 web version of SharePoint.
- Note the URL for this browser view. It should look something like the below example.
https://myorgsitename.sharepoint.com/sites/MYORGNAME/Shared%20Documents/...
- Note that the base of this is the SharePoint URL we are going to use. You want to cut it down to just the part up to and includes MYORGNAME. You want to stop before the part of the URL that begins with
Shared%20Documents
. Of course, the values for the parts that havemyorgsitename
andMYORGNAME
are going to be unique to your account, so be certain to use your appropriate values. It should look something like the following example.
https://myorgsitename.sharepoint.com/sites/MYORGNAME
- Once you have this, this is the proper value for the
Microsoft SharePoint endpoint URL
that you want to use in theURL
setting for this module.
The remaining parameters all behave in the corresponding similar fashion to the parameters you are likely already familiar with in the regular [Files] Find
module. If you wish to review this more please refer to the article Q100012 : Files Find.