Top 3 best ways get all files in a folder using Power Automate

Top 3 best ways get all files in a folder Power Automate

No comments

Loading

In this โ€œGet all files in a folder Power Automateโ€ tutorial, we will learn how to get all files from a given folder in a SharePoint document library using Power Automate. Before getting into the demo, let us understand what the Get Items action of Power Automate offers.

What is Get Items action in Power Automate?

In Power Automate, the โ€œGet itemsโ€ action is used to retrieve items from a SharePoint list. This action allows you to pull data from a specific SharePoint list and use that data within your flow for various operations such as filtering, updating, or processing the items.

Key Features of the โ€œGet itemsโ€ Action

  1. List Selection
    • You can select the SharePoint site and the list from which you want to retrieve items.
  2. Filter Query
    • Allows you to apply OData queries to filter items based on specific conditions (e.g., retrieving items where a status column is equal to โ€˜Completedโ€™).
  3. Order By
    • Specifies the order in which items should be returned. You can order items based on one or more fields (e.g., ordering by creation date).
  4. Top Count
    • Limits the number of items returned by the query. For example, you can retrieve only the top 10 items.
  5. Expand Query
    • Used to retrieve additional fields from related lookup fields, providing more detailed information in a single query.
  6. Pagination
    • Supports pagination to handle large lists by retrieving items in batches.

How to Use the โ€œGet itemsโ€ Action in Power Automate

  1. Create a New Flow
    • Go to Power Automate and create a new flow (e.g., Automated, Instant, or Scheduled flow).
  2. Add โ€œGet itemsโ€ Action
    • Add a new action by clicking on the โ€œNew stepโ€ button.
    • Search for โ€œGet itemsโ€ and select the action from the list of SharePoint actions.
  3. Configure the โ€œGet itemsโ€ Action
    • Site Address: Select or enter the URL of the SharePoint site containing the list.
    • List Name: Choose the name of the list from which you want to retrieve items.
  4. Optional Configuration
    • Filter Query: Enter an OData filter query to filter the items (e.g., Status eq 'Completed').
    • Order By: Specify fields to sort the items (e.g., Created desc).
    • Top Count: Enter a number to limit the number of items returned.
    • Expand Query: Use this to retrieve additional fields from lookup columns.
  5. Use Retrieved Items in the Flow
    • The โ€œGet itemsโ€ action will return an array of items that you can loop through or process in subsequent steps of your flow.
    • Use actions like โ€œApply to eachโ€ to iterate over the retrieved items and perform further actions (e.g., updating items, sending emails).

Example Scenario

Imagine you want to create a flow that retrieves all items from a โ€œTasksโ€ list where the task status is โ€œPendingโ€ and sends an email reminder for each pending task.

  1. Create an Automated Flow Triggered by a Schedule
    • Create a new scheduled flow that runs daily.
  2. Add โ€œGet itemsโ€ Action
    • Configure the action to retrieve items from the โ€œTasksโ€ list with a filter query Status eq 'Pending'.
  3. Loop Through Items
    • Add an โ€œApply to eachโ€ action to loop through the retrieved items.
  4. Send Email for Each Pending Task
    • Inside the loop, add a โ€œSend an emailโ€ action to send a reminder email for each pending task, using fields from the retrieved items (e.g., task title, due date).

By configuring and using the โ€œGet itemsโ€ action in Power Automate, you can efficiently retrieve and process SharePoint list items within your automated workflows.

Method 1: Using Limit Entries to Folder to get all files in a folder Power Automate

Select your folder using the โ€œLimit Entries to Folderโ€ method, and get all files from the selected folder path.

Limit Entries to Folder to get all files in a folder Power Automate
Limit Entries to Folder to get all files in a folder Power Automate

Now, if we execute the Power Automate, we will get all files from the selected folder path: โ€œ/GSD Test Document Library/DS0001โ€

Limit Entries to Folder to get all files in a folder Power Automate demo
Limit Entries to Folder to get all files in a folder Power Automate demo

Notes:

  • The limit entries to folders option is available both in Get items and Get files (properties only).
  • Sometimes, the limit entries to folder option doesnโ€™t work both in Get items and Get files (properties only). That means even if you have documents in the folder, it doesnโ€™t retrieve them.
  • After getting the result from the Get Items or Get Files (properties only) method, you can loop through each document using the apply to each control loop.

Method 2: Using List Folder to get all files in a folder Power Automate

Add a list folder action and select your folder as in the above method.

Using List Folder to get all files in a folder Power Automate
Using List Folder to get all files in a folder Power Automate

In file identifier, click on the show picker icon, select your document library, and select your desired folder or document set.

Using List Folder click on the show picker icon to select your folder
Using List Folder click on the show picker icon to select your folder

Demo: Using List Folder to get all files in a folder Power Automate

Now, after successfully executing the flow, we will get all files from the selected folder path.

Using List Folder to get all files in a folder Power Automate - Demo
Using List Folder to get all files in a folder Power Automate โ€“ Demo

List Folder Output in Power Automate

Below is the output of List Folder execution (example with a single file):


 ย {
ย ย ย ย "Id": "%252fGSD%2bTest%2bDocument%2bLibrary%252fDS0001%252fSample%2bFile%2b1.csv",
ย ย ย ย "Name": "Sample File 1.csv",
ย ย ย ย "DisplayName": "Sample File 1.csv",
ย ย ย ย "Path": "/GSD Test Document Library/DS0001/Sample File 1.csv",
ย ย ย ย "LastModified": "2022-12-10T14:49:35Z",
ย ย ย ย "Size": 380,
ย ย ย ย "MediaType": "text/csv",
ย ย ย ย "IsFolder": false,
ย ย ย ย "ETag": "\"{10951643-66B8-4EE9-AB1C-D665D7AF0BF8},4\"",
ย ย ย ย "FileLocator": "dataset=aHR0cHM6Ly9nbG9iYWxzaGFyZXBvaW50MjAyMC5zaGFyZXBvaW50LmNvbS9zaXRlcy9HU0RSbkQ=,id=JTI1MmZHU0QlMmJUZXN0JTJiRG9jdW1lbnQlMmJMaWJyYXJ5JTI1MmZEUzAwMDElMjUyZlNhbXBsZSUyYkZpbGUlMmIxLmNzdg=="
ย ย }
ย 

Metadata returns by List Folder action in Power Automate

Below are the metadata or file properties returned by the list folder action in Power Automate:

  • ID
  • Name
  • DisplayName
  • Path
  • LastModified
  • Size
  • MediaType
  • IsFolder
  • ETag
  • FileLocator

Note:

  • In the above list, โ€œIDโ€ is not an integer; it returns the file relative path. example given below. So, if you want to query a list item using Get Item or any other method using this ID parameter, it will not work.


"Id": "%252fGSD%2bTest%2bDocument%2bLibrary%252fDS0001%252fSample%2bFile%2b2.csv",

Disadvantage of List Folder action in Power Automate

As we see in the result, we cannot get the value of custom metadata columns in the list folder action; it returns only the out-of-the box file attribute. So, this method is not the right choice if you want to deal with custom metadata columns from the SharePoint Online document library.

Note:

  • Like the Get Items and Get Files (properties only) methods, we can loop through each item in the result of the folder action.

Method 3: Using the โ€œSend an HTTP request to SharePointโ€ to get all files in a folder Power Automate

Using the โ€œSend an HTTP request to SharePointโ€ Power Automate action, we can get all files in a folder.

Using the Send an HTTP request to SharePoint to get all files in a folder Power Automate
Using the Send an HTTP request to SharePoint to get all files in a folder Power Automate

URI:


_api/web/GetFolderByServerRelativeUrl('Your document library name/your folder name')/files

Output returns by GETFolderByServerRelativeUrl request REST API

{

ย  "d": {

ย  ย  "results": [

ย  ย  ย  {

ย  ย  ย  ย  "__metadata": {

ย  ย  ย  ย  ย  "id": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 2.csv')",

ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')",

ย  ย  ย  ย  ย  "type": "SP.File"

ย  ย  ย  ย  },

ย  ย  ย  ย  "Author": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/Author"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "CheckedOutByUser": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/CheckedOutByUser"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "EffectiveInformationRightsManagementSettings": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/EffectiveInformationRightsManagementSettings"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "InformationRightsManagementSettings": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/InformationRightsManagementSettings"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "ListItemAllFields": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/ListItemAllFields"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "LockedByUser": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/LockedByUser"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "ModifiedBy": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/ModifiedBy"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "Properties": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/Properties"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "VersionEvents": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/VersionEvents"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "Versions": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv')/Versions"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "CheckInComment": "",

ย  ย  ย  ย  "CheckOutType": 2,

ย  ย  ย  ย  "ContentTag": "{6CDC34BA-8E9A-4C01-9D6C-624FE0E64D39},4,1",

ย  ย  ย  ย  "CustomizedPageStatus": 0,

ย  ย  ย  ย  "ETag": "\"{6CDC34BA-8E9A-4C01-9D6C-624FE0E64D39},4\"",

ย  ย  ย  ย  "Exists": true,

ย  ย  ย  ย  "IrmEnabled": false,

ย  ย  ย  ย  "Length": "380",

ย  ย  ย  ย  "Level": 1,

ย  ย  ย  ย  "LinkingUri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%202.csv?d=w6cdc34ba8e9a4c019d6c624fe0e64d39",

ย  ย  ย  ย  "LinkingUrl": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 2.csv?d=w6cdc34ba8e9a4c019d6c624fe0e64d39",

ย  ย  ย  ย  "MajorVersion": 3,

ย  ย  ย  ย  "MinorVersion": 0,

ย  ย  ย  ย  "Name": "Sample File 2.csv",

ย  ย  ย  ย  "ServerRelativeUrl": "/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 2.csv",

ย  ย  ย  ย  "TimeCreated": "2022-12-10T14:46:58Z",

ย  ย  ย  ย  "TimeLastModified": "2022-12-10T14:50:31Z",

ย  ย  ย  ย  "Title": null,

ย  ย  ย  ย  "UIVersion": 1536,

ย  ย  ย  ย  "UIVersionLabel": "3.0",

ย  ย  ย  ย  "UniqueId": "6cdc34ba-8e9a-4c01-9d6c-624fe0e64d39"

ย  ย  ย  },

ย  ย  ย  {

ย  ย  ย  ย  "__metadata": {

ย  ย  ย  ย  ย  "id": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 3.docx')",

ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')",

ย  ย  ย  ย  ย  "type": "SP.File"

ย  ย  ย  ย  },

ย  ย  ย  ย  "Author": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/Author"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "CheckedOutByUser": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/CheckedOutByUser"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "EffectiveInformationRightsManagementSettings": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/EffectiveInformationRightsManagementSettings"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "InformationRightsManagementSettings": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/InformationRightsManagementSettings"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "ListItemAllFields": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/ListItemAllFields"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "LockedByUser": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/LockedByUser"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "ModifiedBy": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/ModifiedBy"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "Properties": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/Properties"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "VersionEvents": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/VersionEvents"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "Versions": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx')/Versions"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "CheckInComment": "",

ย  ย  ย  ย  "CheckOutType": 2,

ย  ย  ย  ย  "ContentTag": "{E0CD7FBE-14A9-4471-A217-BB6D7E96D06C},7,10",

ย  ย  ย  ย  "CustomizedPageStatus": 0,

ย  ย  ย  ย  "ETag": "\"{E0CD7FBE-14A9-4471-A217-BB6D7E96D06C},7\"",

ย  ย  ย  ย  "Exists": true,

ย  ย  ย  ย  "IrmEnabled": false,

ย  ย  ย  ย  "Length": "17413",

ย  ย  ย  ย  "Level": 1,

ย  ย  ย  ย  "LinkingUri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%203.docx?d=we0cd7fbe14a94471a217bb6d7e96d06c",

ย  ย  ย  ย  "LinkingUrl": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 3.docx?d=we0cd7fbe14a94471a217bb6d7e96d06c",

ย  ย  ย  ย  "MajorVersion": 4,

ย  ย  ย  ย  "MinorVersion": 0,

ย  ย  ย  ย  "Name": "Sample File 3.docx",

ย  ย  ย  ย  "ServerRelativeUrl": "/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 3.docx",

ย  ย  ย  ย  "TimeCreated": "2022-12-10T14:46:41Z",

ย  ย  ย  ย  "TimeLastModified": "2022-12-24T17:23:02Z",

ย  ย  ย  ย  "Title": "",

ย  ย  ย  ย  "UIVersion": 2048,

ย  ย  ย  ย  "UIVersionLabel": "4.0",

ย  ย  ย  ย  "UniqueId": "e0cd7fbe-14a9-4471-a217-bb6d7e96d06c"

ย  ย  ย  },

ย  ย  ย  {

ย  ย  ย  ย  "__metadata": {

ย  ย  ย  ย  ย  "id": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 1.csv')",

ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')",

ย  ย  ย  ย  ย  "type": "SP.File"

ย  ย  ย  ย  },

ย  ย  ย  ย  "Author": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/Author"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "CheckedOutByUser": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/CheckedOutByUser"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "EffectiveInformationRightsManagementSettings": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/EffectiveInformationRightsManagementSettings"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "InformationRightsManagementSettings": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/InformationRightsManagementSettings"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "ListItemAllFields": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/ListItemAllFields"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "LockedByUser": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/LockedByUser"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "ModifiedBy": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/ModifiedBy"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "Properties": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/Properties"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "VersionEvents": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/VersionEvents"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "Versions": {

ย  ย  ย  ย  ย  "__deferred": {

ย  ย  ย  ย  ย  ย  "uri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/_api/Web/GetFileByServerRelativePath(decodedurl='/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv')/Versions"

ย  ย  ย  ย  ย  }

ย  ย  ย  ย  },

ย  ย  ย  ย  "CheckInComment": "",

ย  ย  ย  ย  "CheckOutType": 2,

ย  ย  ย  ย  "ContentTag": "{10951643-66B8-4EE9-AB1C-D665D7AF0BF8},4,1",

ย  ย  ย  ย  "CustomizedPageStatus": 0,

ย  ย  ย  ย  "ETag": "\"{10951643-66B8-4EE9-AB1C-D665D7AF0BF8},4\"",

ย  ย  ย  ย  "Exists": true,

ย  ย  ย  ย  "IrmEnabled": false,

ย  ย  ย  ย  "Length": "380",

ย  ย  ย  ย  "Level": 1,

ย  ย  ย  ย  "LinkingUri": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/GSD%20Test%20Document%20Library/DS0001/Sample%20File%201.csv?d=w1095164366b84ee9ab1cd665d7af0bf8",

ย  ย  ย  ย  "LinkingUrl": "(add https)globalsharepoint2020.sharepoint.com/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 1.csv?d=w1095164366b84ee9ab1cd665d7af0bf8",

ย  ย  ย  ย  "MajorVersion": 3,

ย  ย  ย  ย  "MinorVersion": 0,

ย  ย  ย  ย  "Name": "Sample File 1.csv",

ย  ย  ย  ย  "ServerRelativeUrl": "/sites/GSDRnD/GSD Test Document Library/DS0001/Sample File 1.csv",

ย  ย  ย  ย  "TimeCreated": "2022-12-10T14:46:58Z",

ย  ย  ย  ย  "TimeLastModified": "2022-12-10T14:49:35Z",

ย  ย  ย  ย  "Title": null,

ย  ย  ย  ย  "UIVersion": 1536,

ย  ย  ย  ย  "UIVersionLabel": "3.0",

ย  ย  ย  ย  "UniqueId": "10951643-66b8-4ee9-ab1c-d665d7af0bf8"

ย  ย  ย  }

ย  ย  ]

ย  }

}

List of file properties or metadata returns by GETFolderByServerRelativeUrl request REST API

  • CheckInComment
  • CheckOutType
  • ContentTag
  • CustomizedPageStatus
  • ETag
  • Exists
  • IrmEnabled
  • Length
  • Level
  • LinkingUri
  • LinkingUrl
  • MajorVersion
  • MinorVersion
  • Name
  • ServerRelativeUrl
  • TimeCreated
  • TimeLastModified
  • Title
  • UIVersion
  • UIVersionLabel
  • UniqueId

Advantages of REST API in Send an HTTP request to SharePoint with Power Automate

Below are the advantages of โ€œSend an HTTP request to SharePoint:โ€

  • This is faster than the above methods.
  • We can include filter query string parameters.
  • The custom metadata columns are not returned by the REST API request GETFolderByServerRelativeUrl.

Key take-away:

From the above 3 methods, only Get Items or Get files (properties only) retrieve files along with all custom metadata; the List Folder and GETFolderByServerRelativeUrl request REST API methods donโ€™t bring the custom metadata columns.

Summary: Get all files in a folder Power Automate

Thus, in this article, we have learned the following with respect to how to get all files in a folder using Power Automate:

  • Limit Entries to Folder in the Get Items query to get all files in a folder.
  • How to use the list folder query to list all files in a folder.
  • How to get all files in a folder using the โ€œGETFolderByServerRelativeUrlโ€ request REST API method

See Also: Power Automate Articles Hub (with real-time example)

If you like our articles, please appreciate our efforts by liking and sharing them with your friends and colleagues. Pleaseย join the mailing listย to get our articles in your inbox as and when we publish them.

Happy automating and learning!

ย 

About Post Author


Discover more from Global SharePoint

Subscribe to get the latest posts sent to your email.

Do you have a better solution or question on this topic? Please leave a comment